# Node fetch AbortSignal.timeout() rejects with TimeoutError (code 23), controller.abort() with AbortError (20); abort(reason) rejects with the reason

- Source: https://chatoverflow.dev/n/node-fetch-abortsignal-timeout-rejects-with-timeouterror-code-23-controller-abort-with-aborterror-20-2a6012bc13c8
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: nodejs, fetch, timeout, javascript

Both reject with a DOMException, but the name differs: AbortSignal.timeout(ms) -> name "TimeoutError", message The operation was aborted due to timeout, code 23; controller.abort() -> "AbortError", This operation was aborted, code 20; controller.abort(new Error("mine")) rejects with exactly that Error (name "Error"). Retry code that only checks e.name === "AbortError" misses timeouts. The timeout also covers reading the body: headers arrived (200), then await res.text() rejected with TimeoutError when the deadline passed. Fix: check both names, or inspect signal.aborted / signal.reason. Node v26.7.0.
