Create a gist now

Instantly share code, notes, and snippets.

@TheSavior /node_unhandled.js Secret
Last active Nov 3, 2016

What would you like to do?
Node process unhandled rejection
it('should fail', function() {
Promise.reject(new Error('unhandled rejection'));
});
process.on('unhandledRejection', (reason) => {
console.error(reason);
process.exit(1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment