yikart/AiToEarn · error
网络繁忙,请稍后重试!
Error message
网络繁忙,请稍后重试!
What it means
In articleTask.tsx, pubCore calls icpCreatePubRecord to create an ImageText publish record for an article task, using FILE_BASE_URL-prefixed remote images as the cover. A falsy result triggers err(), showing the generic toast '网络繁忙,请稍后重试!'. The real failure (backend/IPC) is swallowed by this catch-all message.
Source
Thrown at project/aitoearn-electron/src/views/task/articleTask.tsx:247
const pubCore = async () => {
if (!selectedTask) return;
setPubProgressModuleOpen(true);
setLoading(true);
const err = () => {
setLoading(false);
message.error('网络繁忙,请稍后重试!');
};
// 创建一级记录
const recordRes = await icpCreatePubRecord({
title: selectedTask.title,
desc: selectedTask.description,
type: PubType.ImageText,
coverPath: FILE_BASE_URL + (selectedTask.dataInfo?.imageList?.[0] || ''),
});
if (!recordRes) return err();
let pubList = [];
if (selectedTask.dataInfo?.imageList?.length > 1) {
pubList = selectedTask.dataInfo?.imageList.map(
(v: string) => FILE_BASE_URL + v,
);
}
console.log('pubList', pubList);
console.log(accountListChoose);
for (const account of accountListChoose) {
// 创建二级记录
await icpCreateImgTextPubRecord({
title: selectedTask.title,
desc: selectedTask.description,
type: account.type,
accountId: account.id,View on GitHub (pinned to d3aa8bea5b)
Solutions
- Log the icpCreatePubRecord return and payload in main process to find the real error
- Guard against missing selectedTask.dataInfo/imageList before calling (avoid coverPath = FILE_BASE_URL alone)
- Verify remote cover/image URLs are reachable
- Re-login and confirm backend availability
Example fix
// before
coverPath: FILE_BASE_URL + (selectedTask.dataInfo?.imageList?.[0] || ''),
...
if (!recordRes) return err();
// after
const firstImg = selectedTask.dataInfo?.imageList?.[0];
if (!firstImg) return message.error('任务素材为空,无法发布');
const recordRes = await icpCreatePubRecord({ ..., coverPath: FILE_BASE_URL + firstImg });
if (!recordRes) return err(); Defensive patterns
Strategy: validation
Validate before calling
// before pubCore in ArticleTask
const imgs = selectedTask?.dataInfo?.imageList;
if (!Array.isArray(imgs) || imgs.length === 0) { message.error('任务素材缺失'); return; } Type guard
function hasTaskData(t: unknown): t is { dataInfo: { imageList: string[]; title: string; description?: string } } {
return !!t && typeof t === 'object' && Array.isArray((t as any).dataInfo?.imageList) && (t as any).dataInfo.imageList.length > 0;
} Try / catch
if (!hasTaskData(selectedTask)) { message.error('任务数据未加载完成'); return; }
const recordRes = await icpCreatePubRecord({ ... }).catch(e => { console.error(e); return null; });
if (!recordRes) return err(); Prevention
- Wait for task data to fully load before enabling publish
- Validate remote cover URLs resolve (FILE_BASE_URL + path)
- Handle expired sessions by redirecting to login
- Log the real IPC failure instead of only a generic toast
When it happens
Trigger: icpCreatePubRecord returns null/undefined: backend unreachable, auth invalid, or the payload (selectedTask title/description/cover URL) rejected — e.g., empty imageList so coverPath becomes just FILE_BASE_URL, or selectedTask.dataInfo missing.
Common situations: Task data not fully loaded when the user confirms publishing (dataInfo undefined); CDN file URLs broken; session expired; backend error while creating the record.
Related errors
AI-assisted analysis of yikart/AiToEarn@d3aa8bea5b (2026-08-31).
Data as JSON: /api/errors/ac7cec37527e1b2a.
Report an issue: GitHub.