fix: don't crash when unable to acquire connection

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>
This commit is contained in:
Ricardo Arturo Cabral Mejía 2023-01-17 18:47:59 -05:00
parent 26ae58cc76
commit a519f4f36d

View File

@ -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() {