endgame icon indicating copy to clipboard operation
endgame copied to clipboard

unhandledRejection support?

Open cdaringe opened this issue 9 years ago • 3 comments

now that node people decided to have a whooooole separate means of async i/o failure, i want to catch those too. care if we rev this to add an unhandledRejection handler too?

cdaringe avatar May 25 '16 01:05 cdaringe

👍 running into the same issue.

xjamundx avatar Jul 29 '16 17:07 xjamundx

Here's the very thorough one we've done for our app. Maybe something similar can live here:

process.on('unhandledRejection', (reason, p) => {
    console.error(new Date().toUTCString(), 'unhandledRejection')
    if (reason && reason.stack) {
        console.error(reason.stack)
    } else if (reason) {
        console.error('No stack trace found.')
        console.error('Reason: ', reason)
    } else {
        console.error('No reason given to the unhandled rejection promise')
        console.error(p)
    }
    process.exit(1)
})

xjamundx avatar Jul 29 '16 17:07 xjamundx

I wrote the package perish to address it

On Jul 29, 2016 10:33 AM, "Jamund Ferguson" [email protected] wrote:

Here's the very thorough one we've done for our app. Maybe something similar can live here:

process.on('unhandledRejection', (reason, p) => { console.error(new Date().toUTCString(), 'unhandledRejection') if (reason && reason.stack) { console.error(reason.stack) } else if (reason) { console.error('No stack trace found.') console.error('Reason: ', reason) } else { console.error('No reason given to the unhandled rejection promise') console.error(p) } process.exit(1) })

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/krakenjs/endgame/issues/3#issuecomment-236243042, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9O_R6uSotT8negtP6iqNID0gX2mAZdks5qajlJgaJpZM4ImEtM .

cdaringe avatar Jul 29 '16 17:07 cdaringe