Skip to content

Commit

Permalink
Add error logging in azure queue push
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanIakovlev committed Jan 16, 2025
1 parent 1692af1 commit c9cfd27
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ghcrawler/providers/queuing/storageQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,16 @@ class StorageQueue {
return Promise.all(
requests.map(
qlimit(this.options.parallelPush || 1)(async request => {
const body = JSON.stringify(request)
const queueMessageResult = await this.queueClient.sendMessage(body)
this._log('Queued', request)
return this._buildMessageReceipt(queueMessageResult, request)
try {
const body = JSON.stringify(request)
const queueMessageResult = await this.queueClient.sendMessage(body)
this._log('Queued', request)
return this._buildMessageReceipt(queueMessageResult, request)
} catch (error) {
this.logger.error(`Failed to push message: ${error.message}`)
this.logger.error(`Request: ${JSON.stringify(request, null, 2)}`)
throw error
}
})
)
)
Expand Down

0 comments on commit c9cfd27

Please sign in to comment.