Skip to content

Instantly share code, notes, and snippets.

@AutoSponge
Created April 24, 2018 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AutoSponge/b9235d1861e34f16531b0cf04df8800e to your computer and use it in GitHub Desktop.
Save AutoSponge/b9235d1861e34f16531b0cf04df8800e to your computer and use it in GitHub Desktop.
Unhandled Rejection
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