From a519f4f36ddbb57ad8b07431744e18bbeda400e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Arturo=20Cabral=20Mej=C3=ADa?= Date: Tue, 17 Jan 2023 18:47:59 -0500 Subject: [PATCH] fix: don't crash when unable to acquire connection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ricardo Arturo Cabral Mejía --- src/app/worker.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/worker.ts b/src/app/worker.ts index 42ed397b..b2501143 100644 --- a/src/app/worker.ts +++ b/src/app/worker.ts @@ -28,8 +28,11 @@ export class AppWorker implements IRunnable { } private onError(error: Error) { - debug('error: %o', error) - throw error + if (error.name === 'TypeError' && error.message === "Cannot read properties of undefined (reading '__knexUid')") { + console.error('Unable to acquire connection. Please increase DB_MAX_POOL_SIZE, ') + return + } + console.error('uncaught error:', error) } private onExit() {