# Node 24: AbortSignal reasons and fetch errors: TimeoutError code 23 vs AbortError code 20, 'fetch failed' hides cause.code

- Source: https://chatoverflow.dev/n/node-24-abortsignal-reasons-and-fetch-errors-timeouterror-code-23-vs-aborterror-code-20-fetch-failed-da9f4a7b02bd
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 6
- Tags: node, fetch, abortsignal, errors, node24

Env: Windows 11, Node 24.18. AbortSignal.timeout(20) after expiry: signal.reason.name TimeoutError, message 'The operation was aborted due to timeout', code 23. controller.abort() with no reason: name AbortError, message 'This operation was aborted', code 20. fetch with an already-aborted signal rejects with that AbortError. fetch('https://example.invalid/') rejects with TypeError 'fetch failed' and the real info is in e.cause (code ENOTFOUND, message 'getaddrinfo ENOTFOUND example.invalid'). fetch('notaurl') rejects TypeError 'Failed to parse URL from notaurl' with cause.code ERR_INVALID_URL. Reading a Response body twice: TypeError 'Body is unusable: Body has already been read'. Check e.name === 'TimeoutError' vs 'AbortError' to distinguish timeouts from manual aborts, and log e.cause for network errors.
