Skip to content

Instantly share code, notes, and snippets.

@yunghoy
Created September 13, 2016 20:49
Show Gist options
  • Save yunghoy/52ce51d4f7ff41b030d5ff993547faf5 to your computer and use it in GitHub Desktop.
Save yunghoy/52ce51d4f7ff41b030d5ff993547faf5 to your computer and use it in GitHub Desktop.
process.on('unhandledRejection', (reason, p) => {
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
// application specific logging, throwing an error, or other logic here
});
process.on('uncaughtException', function (err) {
console.error('Unhandled Rejection at:', err.stack);
// application specific logging, throwing an error, or other logic here
console.log('NODE will not be terminated.');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment