1
0
mirror of synced 2025-12-22 19:34:15 -05:00

Avoid an infinite FailBot.report() loop (#22837)

* Avoid an infinite FailBot.report() loop

Part of #1221

* Update middleware/events.js

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
This commit is contained in:
Peter Bengtsson
2021-11-15 20:05:03 -05:00
committed by GitHub
parent 66dab39f3d
commit fab5bef972
2 changed files with 16 additions and 10 deletions

View File

@@ -9,10 +9,20 @@ process.on('uncaughtException', async (err) => {
}
console.error(err)
await FailBot.report(err)
try {
await FailBot.report(err)
} catch (failBotError) {
console.warn('Even sending the uncaughtException error to FailBot failed!')
console.error(failBotError)
}
})
process.on('unhandledRejection', async (err) => {
console.error(err)
await FailBot.report(err)
try {
await FailBot.report(err)
} catch (failBotError) {
console.warn('Even sending the unhandledRejection error to FailBot failed!')
console.error(failBotError)
}
})