hardConceptCodingMidSeniorStaff
A promise rejects and nothing is awaiting it. What does Node do?
An unhandled promise rejection in Node.js means a promise failed before any code observed the error. Treat it as a bug, await or return the promise chain, and make the process-level handler a last-resort alarm.
4 min readUpdated 2026-08-15Target archetype: Big Tech, Enterprise Captive, Product Startup
Answer
Short answer
Always await, return or explicitly catch promises. A process-level unhandledRejection handler is useful for logging and shutdown policy, but it should not be the normal error handling path for request code.
Was this answer helpful?
Likely follow-ups
- Which async operations lose their request context by the time a rejection reaches a global handler, and how would you get the correlation identifier back?
- After an unhandledRejection versus after an uncaughtException, what process state can you still trust?
- How would you make a floating promise a build failure rather than a runtime one?
- When does attaching a .catch a tick late still count as handled, and what does Node print when it does?
Related questions
- Your logs are full of Cannot set headers after they are sent. Walk me through how a request gets into that state.mediumAlso on error-handling and nodejs4 min
- Here is a script mixing setTimeout, a promise chain and an await. Tell me the order the logs come out in, and why.mediumAlso on microtasks and promises4 min
- Walk me through the phases of the Node event loop.mediumAlso on async and microtasks4 min
- A save button calls an API, the request fails, the error appears in the console - and the UI still shows 'Saved'. Walk me through what is actually happening in that promise chain.mediumAlso on promises and async4 min