{"record":{"id":"fecc6ec4ed43bdc7","repo":"transloadit/uppy","slug":"aborterror","errorCode":"AbortError","errorMessage":"Request aborted","messagePattern":"Request aborted","errorType":"exception","errorClass":"DOMException","httpStatus":null,"severity":"warning","filePath":"packages/@uppy/aws-s3/src/s3-client/S3Client.ts","lineNumber":84,"sourceCode":"\n  protected async xhr({\n    url,\n    method,\n    data,\n    onProgress,\n    signal,\n    contentType,\n  }: {\n    url: string\n    method: IT.HttpMethod\n    data?: XMLHttpRequestBodyInit\n    onProgress?: IT.OnProgressFn\n    signal?: AbortSignal\n    contentType?: string\n  }) {\n    // Check if aborted while waiting for online\n    if (signal?.aborted) {\n      throw new DOMException('Request aborted', 'AbortError')\n    }\n\n    return fetcher(url, {\n      method,\n      // XHR natively supports ArrayBuffer, Uint8Array, Blob, and string\n      body: ['GET', 'HEAD'].includes(method) ? undefined : data,\n      headers: contentType ? { 'Content-Type': contentType } : {},\n      signal,\n      timeout: this.requestAbortTimeout,\n      retries: 3,\n      /**\n       * Retry logic:\n       * - Retries: 5xx server errors, 429 rate limiting\n       * - Skips: 4xx client errors (except 429), offline (handled separately)\n       */\n      shouldRetry: (xhr) => {\n        // If offline, don't retry via fetcher - our handler will resume\n        if (this.isOffline()) return false","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/transloadit/uppy/blob/5d4dedd02a1ac0ae022c75c54aca76558f88e256/packages/@uppy/aws-s3/src/s3-client/S3Client.ts#L66-L102","documentation":"The token refresh route /:providerName/refresh-token requires a non-empty string providerName path parameter; 400 is returned when it is missing or empty.","triggerScenarios":"Calling /refresh-token without a provider segment; building the URL from an undefined provider name on the client.","commonSituations":"Client-side URL construction bugs; path prefix stripped by a reverse proxy; provider name variable shadowed or undefined after a refactor.","solutions":["Include the provider name in the path, e.g. /companion/drive/refresh-token","Validate the provider name is a non-empty string before making the request","Fix proxy rewrite rules if the segment is being dropped"],"exampleFix":"// before\nfetch(`${companionUrl}/refresh-token`, { method: 'POST' })\n// after\nfetch(`${companionUrl}/${providerName}/refresh-token`, { method: 'POST' })","handlingStrategy":"validation","validationCode":"if (!providerName) throw new Error('provider name required')\nawait fetch(`${companionUrl}/${encodeURIComponent(providerName)}/refresh-token`, { method: 'POST' })","typeGuard":"const isNonEmptyString = (s: unknown): s is string => typeof s === 'string' && s.length > 0","tryCatchPattern":null,"preventionTips":["Build refresh URLs via a shared helper that validates the provider name","Add e2e tests covering token refresh for each enabled provider"],"tags":["companion","refresh-token","http-400","routing"],"backgroundTag":"invalid-route-parameter","analyzedSha":"5d4dedd02a1ac0ae022c75c54aca76558f88e256","analyzedAt":"2026-08-28T12:18:41.267Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}