Created
April 24, 2018 14:51
-
-
Save AutoSponge/b9235d1861e34f16531b0cf04df8800e to your computer and use it in GitHub Desktop.
Unhandled Rejection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const PrettyError = require('pretty-error') | |
process.on('unhandledRejection', error => { | |
const err = new PrettyError() | |
console.log(err.render(error)) | |
}) | |
// OR | |
const createCallsiteRecord = require('callsite-record') | |
process.on('unhandledRejection', error => { | |
console.log(createCallsiteRecord({ forError: error }).renderSync()) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment