{"record":{"id":"ef8ad52e0ba68cf2","repo":"yikart/AiToEarn","slug":"1","errorCode":null,"errorMessage":"上传视频失败,失败原因1:","messagePattern":"上传视频失败,失败原因1:","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"project/aitoearn-electron/electron/plat/shipinhao/index.ts","lineNumber":770,"sourceCode":"          Authorization: uploadParams.authKey,\n          'Content-Type': 'application/json',\n          'X-Arguments': uploadArgumentsString,\n        },\n        undefined,\n        proxy,\n      );\n\n      if (!uploadCompleteRes.DownloadURL) {\n        throw new Error('上传视频失败,失败原因2:合并分片失败');\n      }\n\n      return uploadCompleteRes.DownloadURL.replace(\n        'http://wxapp.tc.qq.com',\n        'https://finder.video.qq.com',\n      );\n    } catch (err: any) {\n      const errorMessage = err?.message || err || '未知';\n      throw new Error('上传视频失败,失败原因1:' + errorMessage);\n    }\n  }\n\n  /**\n   * 上传封面文件\n   * @param filePath\n   * @param uploadParams\n   */\n  private async uploadCoverFile(\n    filePath: string,\n    uploadParams: any,\n    proxy: string,\n  ): Promise<string> {\n    try {\n      const fileRes = await getFileContent(filePath);\n\n      // 图片数据\n      const fileData = fileRes;","sourceCodeStart":752,"sourceCodeEnd":788,"githubUrl":"https://github.com/yikart/AiToEarn/blob/d3aa8bea5b146a8675607cf0144d891aad3e9683/project/aitoearn-electron/electron/plat/shipinhao/index.ts#L752-L788","documentation":"This is the catch-all wrapper in uploadVideoFile: any error thrown inside the video upload try block (including errors 364/365 or network exceptions) is re-thrown prefixed with '上传视频失败,失败原因1:' and the original message. It is a wrapped error, so the root cause is in the appended message.","triggerScenarios":"Any exception inside uploadVideoFile — fetch failures during chunk upload, missing UploadID, failed merge, JSON parse errors from the COS endpoints, or proxy connection drops.","commonSituations":"Unstable network/proxy during large video uploads, expired upload sessions mid-transfer, COS throttling, or disk read errors streaming the file.","solutions":["Parse the text after '失败原因1:' to find the underlying cause and apply that fix.","Retry the upload with a fresh upload-param request; ensure network/proxy stability.","For very large videos, check timeouts and consider retrying with the file verified locally first.","Add resumable/retry logic around individual chunk uploads before the complete call."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"// verify file and network before initiating\nif (!fs.existsSync(videoPath)) throw new Error('video file missing');\nif (!uploadParams) throw new Error('upload params missing');","typeGuard":null,"tryCatchPattern":"try {\n  await service.uploadVideoFile(/*...*/);\n} catch (e) {\n  if (e.message.startsWith('上传视频失败,失败原因1:')) {\n    const rootCause = e.message.slice('上传视频失败,失败原因1:'.length);\n    console.error('video upload root cause:', rootCause);\n    // branch on rootCause (timeout / 获取上传id失败 / 合并分片失败)\n  }\n}","preventionTips":["Unwrap and log the message after '失败原因1:' to find the real cause","Validate file and upload params before starting","Use a stable network/proxy for large transfers","Wrap caller-side retry around the whole flow with fresh params"],"tags":["upload","shipinhao","wrapped-error","network"],"backgroundTag":"wrapped-upload-failure","analyzedSha":"d3aa8bea5b146a8675607cf0144d891aad3e9683","analyzedAt":"2026-08-31T14:19:24.185Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}