DIYgod/RSSHub · error · Error
message
Error message
message
What it means
Inside the SICAU route, each activity id is fetched in detail via `/getActDetail` and cached with `cache.tryGet`. If the response `code` is anything other than `'0'`, the cached function throws the upstream `message`. Because this happens inside `Promise.all`, a single failing detail call rejects the entire items array, aborting the feed build.
Source
Thrown at lib/routes/sicau/jk.ts:121
id: each.id,
guid: each.id,
title: each.title,
image: each.logo,
}));
const items = await Promise.all(
list.map((item) =>
cache.tryGet(String(item.id), async () => {
const { code, message, content } = await $post(`/getActDetail?actId=${item.id}`);
if (code === '0') {
item.author = content.groupName;
item.pubDate = timezone(parseDate(content.startDate, 'YYYY-MM-DD HH:mm:ss'), 8);
item.category = [content.typeName, content.levelName];
item.description = `<img src="${item.image}" alt="${item.title}" /><p style='white-space: pre-wrap'>${content.description}</p>`;
return item;
}
throw new Error(message);
})
)
);
return {
title: '二课活动 - 四川农业大学',
link: 'https://jk.sicau.edu.cn/act/actInfo/v1.0.0/getUserSchoolActList',
language: 'zh-CN',
item: items as DataItem[],
};
},
};
const typeDict = {
'0': '',
'1': '17a3b11f2d254518b13406ccd18a85b5',
'2': '000392a845ff47d09978c6ddd6dda2d4',
'3': '9ead58d01d3d424ea70b194910893660',View on GitHub (pinned to bed535e087)
Solutions
- Clear the cache entry for the failing id (or wait for TTL) — `cache.tryGet(String(item.id), ...)` will then re-fetch.
- Retry the route; transient backend issues often clear on the next list refresh.
- Patch the handler to skip items whose detail returns `code !== '0'` instead of throwing, so one bad activity does not break the feed.
Example fix
// before
if (code === '0') {
// ... populate item
return item;
}
throw new Error(message);
// after
if (code === '0') {
// ... populate item
return item;
}
return null;
// then filter nulls before returning items Defensive patterns
Strategy: try-catch
Validate before calling
const detail = await $post(`/getActDetail?actId=${item.id}`);
if (detail.code !== '0') {
return null; // skip and filter later
} Type guard
const isDetailOk = (r: unknown): boolean => (r as any)?.code === '0';
Try / catch
try {
item = await cache.tryGet(String(item.id), async () => { /* ... */ throw new Error(message); });
} catch (e) {
if (e instanceof Error) item = null; // tolerate
else throw e;
} Prevention
- Filter nulls after Promise.all so one bad detail does not reject the whole feed.
- Wrap cache.tryGet in try/catch to avoid caching a thrown error.
- Use Promise.allSettled instead of Promise.all for resilience.
When it happens
Trigger: One activity id in the list returns a non-zero code from the detail endpoint (activity deleted between list and detail fetch, restricted, or backend error). Cached failures will keep returning the same error until the cache entry expires.
Common situations: Activity removed after appearing in the list; transient backend 5xx returned as `code !== '0'`; cached bad response keeping the error sticky.
Related errors
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/622e5e876e07a0f3.
Report an issue: GitHub.