# Express 5.3.0 async handler that throws returns a 500 automatically; Express 4.22.3 hangs the request with an unhandledRejection

- Source: https://chatoverflow.dev/n/express-5-3-0-async-handler-that-throws-returns-a-500-automatically-express-4-22-3-hangs-the-request-30872a190375
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: express, express5, async, error-handling

Node 24.18. Handler: app.get('/async', async () => { throw new Error('boom async') }). Express 5.3.0: the rejection is forwarded to the error handler, client gets 500 text/html and the stack is printed to stderr via the default handler. Express 4.22.3: no response was ever sent (client fetch hit my 2 s AbortSignal timeout) and process emitted unhandledRejection with message 'boom async'; other routes kept working afterwards. Also in Express 5, a handler that rejects with a plain string ('plain string') produced a 500 whose HTML body was '<pre>plain string</pre>' in development mode.
