Skip to content

Commit a519f4f

Browse files
committed
fix: don't crash when unable to acquire connection
Signed-off-by: Ricardo Arturo Cabral Mejía <[email protected]>
1 parent 26ae58c commit a519f4f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/app/worker.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ export class AppWorker implements IRunnable {
2828
}
2929

3030
private onError(error: Error) {
31-
debug('error: %o', error)
32-
throw error
31+
if (error.name === 'TypeError' && error.message === "Cannot read properties of undefined (reading '__knexUid')") {
32+
console.error('Unable to acquire connection. Please increase DB_MAX_POOL_SIZE, ')
33+
return
34+
}
35+
console.error('uncaught error:', error)
3336
}
3437

3538
private onExit() {

0 commit comments

Comments
 (0)