{"record":{"id":"f1d43dbf1f6952fa","repo":"DIYgod/RSSHub","slug":"unknown-product-product","errorCode":null,"errorMessage":"Unknown product: ${product}","messagePattern":"Unknown product: (.+?)","errorType":"exception","errorClass":null,"httpStatus":503,"severity":"error","filePath":"lib/routes/bilibili/link-news.ts","lineNumber":38,"sourceCode":"};\n\nasync function handler(ctx) {\n    const product = ctx.req.param('product');\n\n    let productTitle: string;\n\n    switch (product) {\n        case 'live':\n            productTitle = '直播';\n            break;\n        case 'vc':\n            productTitle = '小视频';\n            break;\n        case 'wh':\n            productTitle = '相簿';\n            break;\n        default:\n            throw new Error(`Unknown product: ${product}`);\n    }\n\n    const response = await got({\n        method: 'get',\n        url: `https://api.vc.bilibili.com/news/v1/notice/list?platform=pc&product=${product}&category=all&page_no=1&page_size=20`,\n        headers: {\n            Referer: 'https://link.bilibili.com/p/eden/news',\n        },\n    });\n    const data = response.data.data.items;\n\n    return {\n        title: `bilibili ${productTitle}公告`,\n        link: `https://link.bilibili.com/p/eden/news#/?tab=${product}&tag=all&page_no=1`,\n        description: `bilibili ${productTitle}公告`,\n        item:\n            data &&\n            data.map((item) => ({","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/bilibili/link-news.ts#L20-L56","documentation":"Generic Error thrown by the link-news route when the :product path parameter does not match one of the supported values ('live', 'vc', 'wh'). The switch statement's default case fires. This is a client-side validation error — the route was called with an unsupported product value.","triggerScenarios":"Requesting /bilibili/link/news/:product with a product value other than 'live', 'vc', or 'wh' (e.g., 'video', 'article', 'manga', or a typo).","commonSituations":"User guessed the route parameter incorrectly; typo in the subscription URL; outdated documentation suggesting a parameter value that was never supported.","solutions":["Use one of the three valid product values: 'live' (直播), 'vc' (小视频), or 'wh' (相簿).","Check the route definition / API docs for the accepted parameter values.","Fix the subscription URL in your RSS reader to use a valid product."],"exampleFix":"// before\n// /bilibili/link/news/video\n\n// after\n// /bilibili/link/news/live\n// or\n// /bilibili/link/news/vc\n// or\n// /bilibili/link/news/wh","handlingStrategy":"validation","validationCode":"const validProducts = ['live', 'vc', 'wh'] as const;\nif (!validProducts.includes(product as any)) {\n    throw new Error(`Invalid product '${product}'. Valid: ${validProducts.join(', ')}`);\n}","typeGuard":"function isValidProduct(product: string): product is 'live' | 'vc' | 'wh' {\n    return product === 'live' || product === 'vc' || product === 'wh';\n}","tryCatchPattern":null,"preventionTips":["Validate path parameters against an enum before processing.","Document valid parameter values in the route description.","Return helpful error messages listing valid options."],"tags":["bilibili","validation","invalid-parameters","switch-default","rsshub"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}