{"record":{"id":"b8dbb4dcc074ad34","repo":"yikart/AiToEarn","slug":"error-b8dbb4","errorCode":null,"errorMessage":"网络繁忙，请稍后重试！","messagePattern":"网络繁忙，请稍后重试！","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"project/aitoearn-electron/src/views/publish/children/imagePage/page.tsx","lineNumber":148,"sourceCode":"\n  // 发布\n  const pubCore = async () => {\n    setPubProgressModuleOpen(true);\n    setLoading(true);\n    await signInApi.createSignInRecord();\n\n    const err = () => {\n      setLoading(false);\n      message.error('网络繁忙，请稍后重试！');\n    };\n    // 创建一级记录\n    const recordRes = await icpCreatePubRecord({\n      title: commonPubParams.title,\n      desc: commonPubParams.describe,\n      type: PubType.ImageText,\n      coverPath: images[0].imgPath,\n    });\n    if (!recordRes) return err();\n\n    for (const vData of imageAccounts) {\n      const account = vData.account!;\n      // 创建二级记录\n      await icpCreateImgTextPubRecord({\n        ...vData.pubParams,\n        type: account.type,\n        accountId: account.id,\n        pubRecordId: recordRes.id,\n        publishTime: new Date(),\n        desc: vData.pubParams.describe,\n        coverPath: images[0].imgPath,\n        imagesPath: images.map((v) => v.imgPath),\n      });\n    }\n    const okRes = await icpPubImgText(recordRes.id);\n    setLoading(false);\n    setPubProgressModuleOpen(false);","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/yikart/AiToEarn/blob/d3aa8bea5b146a8675607cf0144d891aad3e9683/project/aitoearn-electron/src/views/publish/children/imagePage/page.tsx#L130-L166","documentation":"In the Electron image-publish page, pubCore calls icpCreatePubRecord to create the top-level publish record. If the IPC call resolves to a falsy value (creation failed on the main process / backend), the code returns err(), which surfaces the generic Ant Design toast '网络繁忙，请稍后重试！' ('Network busy, please retry later'). The message is a catch-all; the real cause is that no publish record was created.","triggerScenarios":"icpCreatePubRecord returns null/undefined because the main-process handler failed — backend server unreachable, auth token invalid, invalid title/desc/coverPath payload, or any backend error creating the ImageText record.","commonSituations":"Electron app not logged in or session expired; local backend/relay server not running; cover image path missing or unreadable on disk; backend 500 while creating the record.","solutions":["Check the main-process/backend logs for the actual icpCreatePubRecord failure; the toast hides the real error","Verify the user is logged in and the token is valid (re-login)","Confirm the backend server is reachable from the Electron app","Validate coverPath (images[0].imgPath) points to an existing file before calling"],"exampleFix":"// before\nconst recordRes = await icpCreatePubRecord({ ... });\nif (!recordRes) return err();\n// after\nconst recordRes = await icpCreatePubRecord({ ... });\nif (!recordRes) {\n  console.error('icpCreatePubRecord failed', { title, coverPath: images[0]?.imgPath });\n  return err();\n}","handlingStrategy":"validation","validationCode":"// before pubCore\nif (!images?.length || !images[0]?.imgPath) { message.error('请先选择图片'); return; }\nif (!commonPubParams.title) { message.error('请填写标题'); return; }","typeGuard":"function isRecordCreated(r: unknown): r is { id: string } {\n  return typeof r === 'object' && r !== null && 'id' in r && typeof (r as any).id === 'string';\n}","tryCatchPattern":"const recordRes = await icpCreatePubRecord({ ... }).catch((e) => { console.error('createPubRecord failed', e); return null; });\nif (!isRecordCreated(recordRes)) {\n  message.error('发布记录创建失败：请检查登录状态和网络');\n  return;\n}","preventionTips":["Ensure the user is logged in before opening the publish page","Log the underlying IPC error instead of only showing the generic toast","Verify cover image files exist on disk before publishing","Check backend server health/connectivity at app startup"],"tags":["electron","ipc","publish-record","generic-error-message"],"backgroundTag":"publish-record-creation-failed","analyzedSha":"d3aa8bea5b146a8675607cf0144d891aad3e9683","analyzedAt":"2026-08-31T14:19:24.185Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}