Skip to content

Commit

Permalink
fix: don't crash when unable to acquire connection
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>
  • Loading branch information
cameri committed Jan 18, 2023
1 parent 26ae58c commit a519f4f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit a519f4f

Please # to comment.