Unhandled promise rejections need their own handler. These occur when you forget to catch async errors.
window.onunhandledrejection = function(event) {
console.error("Unhandled:", event.reason);
event.preventDefault();
};
In Node.js, use process.on('unhandledRejection'). We'll cover async errors more in the next section.