Files
SupportBot/events/unhandledRejection.js
T

11 lines
302 B
JavaScript

process.on('unhandledRejection', error => {
// Will print "unhandledRejection err is not defined"
console.log('unhandledRejection', error.message);
});
new Promise((_, reject) => reject(new Error('woops'))).
catch(error => {
// Will not execute
console.log('caught', err.message);
});