DIYgod/RSSHub · warning · Error
Invalid id: ${id}. Allowed values are: ${[...validIds].join(
Error message
Invalid id: ${id}. Allowed values are: ${[...validIds].join(', ')} What it means
Thrown by the bandisoft history route when the :id path parameter is not one of the values in idOptions (bandizip, bandizip.mac, bandiview, honeycam). It is a whitelist guard built from idOptions, so the error message lists every accepted product id.
Source
Thrown at lib/routes/bandisoft/history.ts:136
},
{
label: 'Romanian',
value: 'ro',
},
{
label: '한국어',
value: 'kr',
},
];
export const handler = async (ctx: Context): Promise<Data> => {
const { id = 'bandizip', language = 'en' } = ctx.req.param();
const limit = Number(ctx.req.query('limit') ?? '500');
const validIds = new Set<string>(idOptions.map((option) => option.value));
if (!validIds.has(id)) {
throw new Error(`Invalid id: ${id}. Allowed values are: ${[...validIds].join(', ')}`);
}
const validLanguages = new Set<string>(languageOptions.map((option) => option.value));
if (!validLanguages.has(language)) {
throw new Error(`Invalid language: ${language}. Allowed values are: ${[...validLanguages].join(', ')}`);
}
const baseUrl = `https://${language}.bandisoft.com`;
const targetUrl: string = new URL(`${id}/history/`, baseUrl).href;
const response = await ofetch(targetUrl);
const $: CheerioAPI = load(response);
const lang = $('html').attr('lang') ?? 'en';
const author: string | undefined = $('meta[name="author"]').attr('content');
const items: DataItem[] = $('div.row')
.slice(0, limit)View on GitHub (pinned to bed535e087)
Solutions
- Use one of: bandizip, bandizip.mac, bandiview, honeycam (the message lists them).
- If adding a new Bandisoft product, append it to idOptions so both validation and docs stay consistent.
Defensive patterns
Strategy: validation
Validate before calling
const VALID_IDS = new Set(idOptions.map((o) => o.value));
if (!VALID_IDS.has(id)) {
throw new InvalidParameterError(`Invalid id: ${id}. Allowed: ${[...VALID_IDS].join(', ')}`);
} Type guard
function isBandisoftId(v: string): boolean {
return idOptions.some((o) => o.value === v);
} Prevention
- Expose the allow-list in the route's parameters.options so RSSHub surfaces valid values in docs/UI.
- Use InvalidParameterError for whitelist failures.
When it happens
Trigger: Calling /bandisoft/history/:id with an id outside the supported set, e.g. a typo like 'bandizip-mac' (dot vs dash) or a product bandisoft does not have a changelog for.
Common situations: User guesses a product slug; outdated doc lists a removed product; case mismatch (ids are lowercase, the check is case-sensitive).
Related errors
- Invalid language: ${language}. Allowed values are: ${[...val
- Invalid category: ${categoryParam}. Valid categories are: ${
- 无效的排序类型
- 关键词不能为空
- Unsupported server
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/4463e9b5ea1e933d.
Report an issue: GitHub.