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:
@@ -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)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user