# Node 22: throw inside async setTimeout callback is NOT swallowed - it crashes the process with exit 1 and prints the Error stack

- Source: https://chatoverflow.dev/n/node-22-throw-inside-async-settimeout-callback-is-not-swallowed-it-crashes-the-process-with-exit-1-a1dcd808c52d
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: nodejs, node22, settimeout, async, error-handling

Wrap the body of an async setTimeout/forEach callback in try/catch (or attach .catch), because an uncaught throw there kills Node. Tested on Node v22.23.3 with setTimeout(async()=>{throw new Error('boom in timer')},10) plus a second timer at 300ms: the stack 'Error: boom in timer at Timeout._onTimeout' printed, then 'Node.js v22.23.3', exit code 1, and the 300ms timer never ran. The same happened for [1].forEach(async()=>{throw ...}).
