yikart/AiToEarn · error

网络繁忙,请稍后重试!

Error message

网络繁忙,请稍后重试!

What it means

In task.tsx, handleAccountConfirm creates an ImageText publish record via icpCreatePubRecord using sucai (material) title/desc/cover. If the IPC/backend call returns falsy, err() shows the generic '网络繁忙,请稍后重试!' toast and publishing aborts before per-account sub-records are created.

Source

Thrown at project/aitoearn-electron/src/views/task/task.tsx:510

    const err = () => {
      setLoading(false);
      message.error('网络繁忙,请稍后重试!');
    };

    // 00.00 测试
    // console.log('1', selectedTask);
    // return;

    // topics: selectedTask.dataInfo?.topicList || [],

    // 创建一级记录
    const recordRes = await icpCreatePubRecord({
      title: sucai.title || selectedTask.dataInfo?.title,
      desc: sucai.desc || selectedTask.dataInfo?.desc,
      type: PubType.ImageText,
      coverPath: FILE_BASE_URL + (sucai.coverUrl || ''),
    });
    if (!recordRes) return err();

    let pubList = [];
    console.log('sucai.imageList', sucai.imageList);
    if (sucai.imageList.length) {
      pubList = sucai.imageList.map((v: any) => {
        console.log('v', v);
        return FILE_BASE_URL + v.imageUrl;
      });
    }

    console.log('pubList', pubList);
    console.log('accountListChoose', accountListChoose);

    const allAccount = accountListChoose?.length
      ? accountListChoose
      : [account];
    console.log('allAccount', allAccount);

View on GitHub (pinned to d3aa8bea5b)

Solutions

  1. Check main-process logs for the actual record-creation error
  2. Validate sucai fields (title/coverUrl/imageList) before invoking publish
  3. Re-login if the session expired; verify backend server health
  4. Replace the generic toast with the backend error detail for diagnosability

Example fix

// before
const recordRes = await icpCreatePubRecord({ ... });
if (!recordRes) return err();
let pubList = [];
if (sucai.imageList.length) {
// after
const recordRes = await icpCreatePubRecord({ ... });
if (!recordRes) return err();
let pubList = [];
if (Array.isArray(sucai.imageList) && sucai.imageList.length) {
Defensive patterns

Strategy: validation

Validate before calling

// before handleAccountConfirm publishes
if (!sucai || (!sucai.title && !selectedTask?.dataInfo?.title)) { message.error('素材缺少标题'); return; }
if (!Array.isArray(sucai.imageList)) { message.error('素材图片列表无效'); return; }

Type guard

function hasValidSucai(s: unknown): s is { title?: string; desc?: string; coverUrl?: string; imageList: unknown[] } {
  return !!s && typeof s === 'object' && Array.isArray((s as any).imageList);
}

Try / catch

if (!hasValidSucai(sucai)) { message.error('素材数据不完整'); return; }
const recordRes = await icpCreatePubRecord({ ... }).catch(e => { console.error(e); return null; });
if (!recordRes) return err();

Prevention

When it happens

Trigger: icpCreatePubRecord resolves null/undefined: backend unreachable, invalid auth, or bad payload — e.g., sucai has no coverUrl so coverPath is just FILE_BASE_URL, or sucai.imageList missing causing downstream errors after record creation.

Common situations: Material (sucai) data incomplete when publishing; session expired; backend 500; image list empty but code proceeds assuming it exists (subsequent .map on undefined).

Related errors


AI-assisted analysis of yikart/AiToEarn@d3aa8bea5b (2026-08-31). Data as JSON: /api/errors/2ff5859ec8e517cf. Report an issue: GitHub.