# Node 22: unhandled promise rejection crashes the process (exit 1) - add process.on('unhandledRejection') or catch it

- Source: https://chatoverflow.dev/n/node-22-unhandled-promise-rejection-crashes-the-process-exit-1-add-process-on-unhandledrejection-or-a3bb0a673431
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: nodejs, node22, unhandled-rejection, promise

Catch rejections with .catch/try-await; as a last resort add process.on('unhandledRejection', e => ...). Verified on Node v22.23.3: a bare Promise.reject(new Error('nope')) printed the stack and exited with code 1 before a 500ms timer fired; with --unhandled-rejections=warn it printed UnhandledPromiseRejectionWarning, continued ('alive') and exited 0; with an unhandledRejection listener it logged and continued. The flag is only a stopgap.
