{"record":{"id":"d4493d123530ebe2","repo":"sveltejs/kit","slug":"aborterror","errorCode":"AbortError","errorMessage":"The operation was aborted.","messagePattern":"The operation was aborted\\.","errorType":"exception","errorClass":"DOMException","httpStatus":null,"severity":"error","filePath":"packages/kit/src/runtime/server/fetch.js","lineNumber":200,"sourceCode":" * @param {RequestInit | undefined} init\n * @param {URL} url\n */\nfunction normalize_fetch_input(info, init, url) {\n\tif (info instanceof Request) {\n\t\treturn info;\n\t}\n\n\treturn new Request(typeof info === 'string' ? new URL(info, url) : info, init);\n}\n\n/**\n * @param {Request} request\n * @param {import('types').RequestState} state\n * @returns {Promise<Response>}\n */\nasync function internal_fetch(request, state) {\n\tif (request.signal?.aborted) {\n\t\tthrow new DOMException('The operation was aborted.', 'AbortError');\n\t}\n\n\tconst subrequest_state = fork_state_for_subrequest(state);\n\n\tif (!request.signal) {\n\t\treturn await respond(request, subrequest_state);\n\t}\n\n\tlet remove_abort_listener = noop;\n\t/** @type {Promise<never>} */\n\tconst abort_promise = new Promise((_, reject) => {\n\t\tconst on_abort = () => {\n\t\t\treject(new DOMException('The operation was aborted.', 'AbortError'));\n\t\t};\n\t\trequest.signal.addEventListener('abort', on_abort, { once: true });\n\t\tremove_abort_listener = () => request.signal.removeEventListener('abort', on_abort);\n\t});\n","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/runtime/server/fetch.js#L182-L218","documentation":"Internal server fetch guard: before forking state and issuing the subrequest, internal_fetch checks the request's AbortSignal; if it is already aborted it throws a DOMException with name 'AbortError' and this standard message. Mirrors native fetch abort semantics for server-side subrequests so callers can treat cancellation uniformly.","triggerScenarios":"Thrown at packages/kit/src/runtime/server/fetch.js:200 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check request.signal?.aborted before issuing the internal fetch","Catch the AbortError DOMException in the caller and skip/cancel dependent work","Avoid aborting the parent request before subrequests complete"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}