{"record":{"id":"5f27478f116f6f7c","repo":"chatboxai/chatbox","slug":"unknown-error","errorCode":null,"errorMessage":"Unknown error","messagePattern":"Unknown error","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/shared/request/request.ts","lineNumber":156,"sourceCode":"        return res\n      } catch (e) {\n        if (isAbortError(e, init?.signal)) {\n          throw e\n        }\n        if (e instanceof BaseError) {\n          requestError = e\n        } else {\n          const err = toError(e)\n          const origin = getRequestOrigin(url)\n          requestError = new NetworkError(err.message, origin)\n        }\n        await new Promise((resolve) => setTimeout(resolve, 500))\n      }\n    }\n    if (requestError) {\n      throw requestError\n    } else {\n      throw new Error('Unknown error')\n    }\n  }\n}\n\nexport async function uploadFile(file: File, url: string) {\n  // COS 需要使用原始的 XMLHttpRequest（根据官网示例）\n  // 如果使用 fetch，会导致上传的 excel、docx 格式不正确\n  return new Promise((resolve, reject) => {\n    const xhr = new XMLHttpRequest()\n    xhr.open('PUT', url, true)\n    xhr.upload.onprogress = () => {\n      // do nothing\n    }\n    xhr.onload = () => {\n      if (/^2\\d\\d$/.test(`${xhr.status}`)) {\n        const ETag = xhr.getResponseHeader('etag')\n        resolve({ url: url, ETag: ETag })\n      } else {","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/shared/request/request.ts#L138-L174","documentation":"Error \"Unknown error\" thrown in chatboxai/chatbox.","triggerScenarios":"Thrown at src/shared/request/request.ts:156 when the library encounters an invalid state.","commonSituations":"Occurs in src/shared/request/request.ts when a caught error has no extractable message and the generic fallback 'Unknown error' is thrown.","solutions":["This is a defensive fallback when all retries finished without capturing an error; check logs for the underlying fetch failure.","Verify network connectivity and that the request URL is valid.","Report the issue if reproducible, since it indicates an unrecorded failure path in the retry loop."],"exampleFix":"if (requestError) {\n  throw requestError\n} else {\n  // Unreachable in normal flow; instrument retry loop to always record an error\n  throw new Error('Unknown error')\n}","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"81571269addb6bafb589a920b2883f1e1e084fd1","analyzedAt":"2026-08-12T21:51:44.981Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}