{"record":{"id":"be2b264d3f77af8e","repo":"transloadit/uppy","slug":"aborterror-be2b26","errorCode":"AbortError","errorMessage":"Request aborted","messagePattern":"Request aborted","errorType":"exception","errorClass":"DOMException","httpStatus":null,"severity":"warning","filePath":"packages/@uppy/aws-s3/src/s3-client/S3mini.ts","lineNumber":306,"sourceCode":"    data,\n    onProgress,\n    signal,\n    contentType,\n    shouldRetryCredentials = true,\n  }: {\n    request: IT.PresignableRequest\n    data?: XMLHttpRequestBodyInit\n    onProgress?: IT.OnProgressFn\n    signal?: AbortSignal\n    contentType?: string\n    shouldRetryCredentials?: boolean\n  }): Promise<{ xhr: XMLHttpRequest; url: string }> {\n    // Wait for online before starting\n    await this.waitForOnline(signal)\n\n    // Check if aborted while waiting for online\n    if (signal?.aborted) {\n      throw new DOMException('Request aborted', 'AbortError')\n    }\n\n    try {\n      const { url } = await this.signRequest(request)\n\n      const xhr = await this.xhr({\n        url,\n        method: request.method,\n        data,\n        onProgress,\n        signal,\n        contentType,\n      })\n\n      return { xhr, url }\n    } catch (err: unknown) {\n      // NetworkError or errors with attached XHR (from onAfterResponse throws)\n      if (","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/transloadit/uppy/blob/5d4dedd02a1ac0ae022c75c54aca76558f88e256/packages/@uppy/aws-s3/src/s3-client/S3mini.ts#L288-L324","documentation":"The generic `request` method checks the AbortSignal after waiting for connectivity (waitForOnline) and throws `new DOMException('Request aborted', 'AbortError')` if the caller cancelled while the client was offline-waiting. This gives a standard AbortError so callers' `signal.aborted` handling and `e.name === 'AbortError'` checks work uniformly.","triggerScenarios":"The client goes offline, request() parks in waitForOnline, and the app aborts via AbortController (e.g. user cancelled an upload) — or the signal was already aborted when the check runs. All S3 operations (putObject, uploadPart, createMultipartUpload, etc.) funnel through request(), so any of them can surface this.","commonSituations":"User cancels an upload in the UI during a network dropout; a timeout wrapper aborts requests that stall waiting for connectivity; navigating away from a page that aborts in-flight uploads; deliberate offline-pause then cancel flows.","solutions":["Treat AbortError as an intentional cancellation, not a failure: check `err.name === 'AbortError'` and skip retries.","Ensure only one cancellation source owns the controller; if you compose timeout + user-cancel signals, use AbortSignal.any([...]).","If you didn't intend cancellation, find which code calls `controller.abort()` (timeout, unmount cleanup, route change)."],"exampleFix":"// before\ntry { await s3.putObject(...) } catch (e) { retry() } // retries user-cancelled request\n// after\ntry { await s3.putObject(...) } catch (e) {\n  if (e.name === 'AbortError') return // intentional cancel, don't retry\n  throw e\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"const isAbortError = (e: unknown): e is DOMException =>\n  e instanceof DOMException && e.name === 'AbortError'","tryCatchPattern":"try { await s3.uploadPart(...) } catch (e) { if (e instanceof DOMException && e.name === 'AbortError') return /* cancelled — do not retry */; throw e }","preventionTips":["Check err.name === 'AbortError' before any retry logic.","Keep user-cancel and timeout abort controllers separate, or compose with AbortSignal.any.","Clean up abort listeners after uploads complete to avoid accidental aborts."],"tags":["aws-s3","abort","abortsignal","network","cancellation"],"backgroundTag":"request-aborted","analyzedSha":"5d4dedd02a1ac0ae022c75c54aca76558f88e256","analyzedAt":"2026-08-28T12:18:41.267Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}