Skip to content

Commit

Permalink
fix: catch errors in worker
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentuso committed Feb 4, 2021
1 parent 90033ca commit c9ac4e3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/@uppy/companion/src/server/controllers/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ const queue = (() => {
async start () {
while (stateForTenantId(this.tenantId).actions.length) {
const action = stateForTenantId(this.tenantId).actions.shift()
await action()
try {
await action()
} catch (e) {
logger.error(e, 'controller.get.worker.start')
}
}
this.isDone = true
}
Expand Down Expand Up @@ -93,6 +97,7 @@ function get (req, res, next) {
// Otherwise clean up and try again
uploader.cleanUp()
uploader = new Uploader(Uploader.reqToOptions(req, size))
logger.error(err, 'controller.get.provider.download', req.id)
reject(err)
return
}
Expand Down

0 comments on commit c9ac4e3

Please sign in to comment.