{"record":{"id":"cbc22db532a2fe52","repo":"DIYgod/RSSHub","slug":"unknown-site-site","errorCode":null,"errorMessage":"unknown site: ${site}","messagePattern":"unknown site: (.+?)","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":null,"severity":"warning","filePath":"lib/routes/bugzilla/bug.ts","lineNumber":21,"sourceCode":"\nimport InvalidParameterError from '@/errors/types/invalid-parameter';\nimport type { Data, DataItem, Route } from '@/types';\nimport ofetch from '@/utils/ofetch';\nimport { parseDate } from '@/utils/parse-date';\n\nconst INSTANCES = new Map([\n    ['apache', 'bz.apache.org/bugzilla'],\n    ['apache.ooo', 'bz.apache.org/ooo'], // Apache OpenOffice\n    ['apache.SpamAssassin', 'bz.apache.org/SpamAssassin'],\n    ['kernel', 'bugzilla.kernel.org'],\n    ['mozilla', 'bugzilla.mozilla.org'],\n    ['webkit', 'bugs.webkit.org'],\n]);\n\nasync function handler(ctx: Context): Promise<Data> {\n    const { site, bugId } = ctx.req.param();\n    if (!INSTANCES.has(site)) {\n        throw new InvalidParameterError(`unknown site: ${site}`);\n    }\n    const link = `https://${INSTANCES.get(site)}/show_bug.cgi?id=${bugId}`;\n    const xml = await ofetch(`${link}&ctype=xml`);\n    const $ = load(xml);\n    const items = $('long_desc').map((index, rawItem) => {\n        const $ = load(rawItem, null, false);\n        return {\n            title: `comment #${$('commentid').text()}`,\n            link: `${link}#c${index}`,\n            description: $('thetext').text(),\n            pubDate: parseDate($('bug_when').text()),\n            author: $('who').attr('name'),\n        } as DataItem;\n    });\n    return { title: $('short_desc').text(), link, item: items.toArray() };\n}\n\nfunction markdownFrom(instances: Map<string, string>, separator: string = ', '): string {","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/bugzilla/bug.ts#L3-L39","documentation":"Thrown by the Bugzilla aggregator route when the `site` path parameter is not a key in the `INSTANCES` map. The map enumerates six supported Bugzilla deployments (apache, apache.ooo, apache.SpamAssassin, kernel, mozilla, webkit). Unlike most peers, this route correctly uses `InvalidParameterError`, which RSSHub translates into an HTTP 400 with a readable message.","triggerScenarios":"Calling `/bugzilla/<unknown-site>/<bugId>` where `<unknown-site>` is not one of apache, apache.ooo, apache.SpamAssassin, kernel, mozilla, webkit. Misspellings like `mozila`, `apche`, or unsupported trackers like `gnome`, `freedesktop`, `redhat`.","commonSituations":"User assumes their favourite Bugzilla is supported, copy-paste from a docs page that predates the supported-list, or case sensitivity ('Apache' vs 'apache').","solutions":["Use one of the six supported keys: apache, apache.ooo, apache.SpamAssassin, kernel, mozilla, webkit.","Note keys are case-sensitive; use the exact lowercase (except the mixed-case apache.SpamAssassin / apache.ooo compound keys).","To extend support, add the instance hostname to the `INSTANCES` map in lib/routes/bugzilla/bug.ts."],"exampleFix":"// before\n/bugzilla/redhat/12345\n// after\n/bugzilla/mozilla/12345","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set(['apache', 'apache.ooo', 'apache.SpamAssassin', 'kernel', 'mozilla', 'webkit']);\nif (!SUPPORTED.has(site)) {\n    // do not call the route; surface a client-side error\n}","typeGuard":"const BUGZILLA_SITES = ['apache', 'apache.ooo', 'apache.SpamAssassin', 'kernel', 'mozilla', 'webkit'] as const;\ntype BugzillaSite = typeof BUGZILLA_SITES[number];\nfunction isBugzillaSite(s: string): s is BugzillaSite {\n    return (BUGZILLA_SITES as readonly string[]).includes(s);\n}","tryCatchPattern":null,"preventionTips":["Treat the supported-site list as versioned; re-check after upgrading RSSHub.","Remember compound keys (apache.ooo, apache.SpamAssassin) are case-sensitive.","Request additions to the INSTANCES map rather than passing unsupported hosts."],"tags":["validation","user-input","invalid-parameter-error","map-lookup"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}