yikart/AiToEarn · error
网络繁忙,请稍后重试!
Error message
网络繁忙,请稍后重试!
What it means
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.
Source
Thrown at project/aitoearn-electron/src/views/publish/children/imagePage/page.tsx:148
// 发布
const pubCore = async () => {
setPubProgressModuleOpen(true);
setLoading(true);
await signInApi.createSignInRecord();
const err = () => {
setLoading(false);
message.error('网络繁忙,请稍后重试!');
};
// 创建一级记录
const recordRes = await icpCreatePubRecord({
title: commonPubParams.title,
desc: commonPubParams.describe,
type: PubType.ImageText,
coverPath: images[0].imgPath,
});
if (!recordRes) return err();
for (const vData of imageAccounts) {
const account = vData.account!;
// 创建二级记录
await icpCreateImgTextPubRecord({
...vData.pubParams,
type: account.type,
accountId: account.id,
pubRecordId: recordRes.id,
publishTime: new Date(),
desc: vData.pubParams.describe,
coverPath: images[0].imgPath,
imagesPath: images.map((v) => v.imgPath),
});
}
const okRes = await icpPubImgText(recordRes.id);
setLoading(false);
setPubProgressModuleOpen(false);View on GitHub (pinned to d3aa8bea5b)
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
Example fix
// before
const recordRes = await icpCreatePubRecord({ ... });
if (!recordRes) return err();
// after
const recordRes = await icpCreatePubRecord({ ... });
if (!recordRes) {
console.error('icpCreatePubRecord failed', { title, coverPath: images[0]?.imgPath });
return err();
} Defensive patterns
Strategy: validation
Validate before calling
// before pubCore
if (!images?.length || !images[0]?.imgPath) { message.error('请先选择图片'); return; }
if (!commonPubParams.title) { message.error('请填写标题'); return; } Type guard
function isRecordCreated(r: unknown): r is { id: string } {
return typeof r === 'object' && r !== null && 'id' in r && typeof (r as any).id === 'string';
} Try / catch
const recordRes = await icpCreatePubRecord({ ... }).catch((e) => { console.error('createPubRecord failed', e); return null; });
if (!isRecordCreated(recordRes)) {
message.error('发布记录创建失败:请检查登录状态和网络');
return;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
AI-assisted analysis of yikart/AiToEarn@d3aa8bea5b (2026-08-31).
Data as JSON: /api/errors/b8dbb4dcc074ad34.
Report an issue: GitHub.