Skip to content

Instantly share code, notes, and snippets.

@gigafied
Created June 13, 2017 21:15
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 gigafied/8bf259801f392eaf3cf057fafde626e9 to your computer and use it in GitHub Desktop.
Save gigafied/8bf259801f392eaf3cf057fafde626e9 to your computer and use it in GitHub Desktop.
uncaughtRejection
process.on('uncaughtException', err => console.error('uncaughtException', err))
process.on('uncaughtRejection', err => process.emit('uncaughtException', err))
const example = () => {
return new Promise((resolve, reject) => {
setTimeout(() => reject(new Error('Uh oh')), 1000)
})
}
example()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment