Node.js - Error Handling Patterns
You wrote this code to catch unhandled promise rejections:
But the console shows
process.on('unhandledRejection', (error) => {
console.log('Caught:', error);
});
Promise.reject('Oops!');But the console shows
Caught: Oops! instead of an error message. What is the issue?