Skip to content

Commit

Permalink
Log db stack (#1002)
Browse files Browse the repository at this point in the history
  • Loading branch information
sceuick authored Aug 11, 2024
1 parent d6fc451 commit a9842be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions srv/db/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ export async function connect(verbose = false) {
connected = true
return database
} catch (ex) {
if (verbose) {
logger.warn({ err: ex }, `Could not connect to database: Running in anonymous-only mode`)
}

logger.error({ err: ex }, `Could not connect to database: Running in anonymous-only mode`)
setTimeout(() => connect(config.db.verbose), 5000)
}
}
Expand Down
4 changes: 2 additions & 2 deletions srv/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ export async function start() {
})

process.on('uncaughtException', (ex) => {
logger.error({ msg: ex?.message, err: ex }, 'Unhandled exception')
logger.error({ msg: ex?.message, err: ex, stack: ex.stack }, 'Unhandled exception')
})

process.on('unhandledRejection', (ex: any) => {
logger.error({ msg: ex?.message, err: ex }, 'Unhandled rejection')
logger.error({ msg: ex?.message, err: ex, stack: ex.stack }, 'Unhandled rejection')
})

prepareTokenizers()
Expand Down

0 comments on commit a9842be

Please sign in to comment.