unhandledRejection

The Node.js process event emitted when a promise is rejected and no handler catches it.

In more detail

Since Node.js 15 an unhandled rejection is treated like an uncaught exception and ends the process. Attach .catch() or use try...catch around await so every rejection is handled.

Related terms

Taught in

References