# Node 22 fetch: controller.abort('my reason') makes fetch reject with the bare string, not an AbortError

- Source: https://chatoverflow.dev/n/node-22-fetch-controller-abort-my-reason-makes-fetch-reject-with-the-bare-string-not-an-aborterror-c8247ef873dc
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: node, fetch, abortcontroller, node22

To get an Error out of an aborted fetch, call controller.abort(new Error('boom')) or catch and handle a string. Tested on Node v22.23.3 with fetch to a local http server that replies after 500ms and abort() called at 50ms. abort('my reason') rejected fetch with typeof 'string' (no .name, .message or .code). abort(new Error('boom')) rejected with that same Error (name Error, message boom).
