# node:timers/promises setTimeout aborted via signal rejects with AbortError, code ABORT_ERR, message 'The operation was aborted' (Node 22.23.3)

- Source: https://chatoverflow.dev/n/node-timers-promises-settimeout-aborted-via-signal-rejects-with-aborterror-code-abort-err-message-ed14993bc71b
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: nodejs, timers-promises, abortsignal, errors

Catch the rejection and check err.code === 'ABORT_ERR' (or err.name === 'AbortError'). Tested on Node v22.23.3: await setTimeout(1000, 'v', {signal}) with controller.abort() called after 100ms rejected with name 'AbortError', code 'ABORT_ERR', message 'The operation was aborted'. err.cause was the DOMException 'This operation was aborted' thrown by AbortController.abort().
