DIYgod/RSSHub · error · Error
${data.message}
Error message
${data.message} What it means
Thrown by the MIUI community user-posts route when the upstream api.vip.miui.com announce-list endpoint returns data.code !== 200. The handler passes the upstream API's own `data.message` straight through as the error text, so the message you see is whatever Xiaomi's API returned (rate-limit, invalid uid, auth required, etc.). It is a bare `throw new Error(data.message)`.
Source
Thrown at lib/routes/miui/community/user.ts:67
authorName = item.author.name;
return {
title: item.title || `${authorName} 的动态`,
description: item.textContent,
pubDate: new Date(item.createTime).toUTCString(),
author: item.author.name,
link: `${pageRoot}?postId=${item.id}`,
image: item.pic || item.cover || '',
};
});
return {
title: `小米社区 - ${authorName} 的发帖`,
link: userLink,
description: `${authorName} 的发帖`,
item: items,
language: 'zh-CN',
};
}
throw new Error(data.message);
}
View on GitHub (pinned to bed535e087)
Solutions
- Verify the uid at https://web.vip.miui.com/page/info/mio/mio/homePage?uid=<uid> — if the profile is empty/404 the uid is wrong.
- Reproduce the upstream call with curl (including the Referer header) and read data.message to learn the exact upstream reason.
- If the API now requires auth, supply the necessary cookie/token header (mirror how a logged-in browser requests the page).
- Retry after a short delay if the message indicates a transient rate-limit.
Example fix
// before
if (data.code === 200) {
// ... build feed
}
throw new Error(data.message);
// after — include the code and a hint for unknown messages
if (data.code === 200) {
// ... build feed
}
throw new Error(`MIUI API error (code ${data.code}): ${data.message || 'unknown error for uid ' + uid}`); Defensive patterns
Strategy: try-catch
Validate before calling
const uid = ctx.req.param('uid');
if (!/^\d+$/.test(uid)) {
throw new InvalidParameterError(`uid must be numeric; got: ${uid}`);
} Type guard
function isMiuiOk(data: any): data is { code: 200; entity: { records: any[] } } {
return data?.code === 200 && Array.isArray(data?.entity?.records);
} Try / catch
try {
const { data } = await got({ method: 'get', url: apiLink, headers: { Referer: userLink } });
if (data.code !== 200) {
throw new Error(`MIUI API error (code ${data.code}): ${data.message}`);
}
// ... build feed
} catch (e) {
// rethrow typed, or fall back to a stale cached feed if available
throw e;
} Prevention
- Validate uid is numeric before the request.
- Map known upstream codes (auth/rate-limit) to typed errors with actionable messages.
- Consider caching the last successful feed to serve during transient upstream errors.
When it happens
Trigger: The handler GETs api/community/user/announce/list?uid=<uid>&limit=10 with a Referer. If data.code is anything other than 200 (e.g. 401 auth required, 429 rate-limited, 400 invalid uid, or an internal error code), it throws the API's message.
Common situations: An invalid or non-existent uid; MIUI's API now requires a login cookie/token for this endpoint; the source IP is rate-limited or region-blocked; transient upstream outage returning an error envelope.
Related errors
- HTTP error! status: ${res.status}
- 日报数据不存在或为空
- BAIDU_COOKIE must contain BDUSS. Please check your cookie co
- message ?? code
- 缺少对应 loginUid 的 Bilibili 用户登录后的 Cookie 值 <a href="https://do
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/00e5c80dd5ab1bb0.
Report an issue: GitHub.