From c9ac4e353cde805ce70179d218148844ed02bc06 Mon Sep 17 00:00:00 2001 From: stephentuso Date: Thu, 4 Feb 2021 13:48:29 -0500 Subject: [PATCH] fix: catch errors in worker --- packages/@uppy/companion/src/server/controllers/get.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/@uppy/companion/src/server/controllers/get.js b/packages/@uppy/companion/src/server/controllers/get.js index 5f341be3fe..fef74f6b69 100644 --- a/packages/@uppy/companion/src/server/controllers/get.js +++ b/packages/@uppy/companion/src/server/controllers/get.js @@ -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 } @@ -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 }