Unhandled rejection xảy ra khi Promise bị rejected mà không có .catch() handler.
Trong Node.js v15+ sẽ terminate process theo mặc định (cấu hình qua --unhandled-rejections flag), trong browser hiện warning. Xử lý: luôn thêm .catch(), dùng process.on('unhandledRejection'), window.addEventListener('unhandledrejection'). Tốt nhất: luôn handle errors tại source.
An unhandled rejection occurs when a Promise is rejected without a .catch() handler.
In Node.js v15+ this terminates the process by default (configurable via --unhandled-rejections flag); in browsers it shows a warning. Handle by: always adding .catch(), using process.on('unhandledRejection'), or window.addEventListener('unhandledrejection'). Best practice: always handle errors at the source.