{"record":{"id":"b860a65553c7a10f","repo":"DIYgod/RSSHub","slug":"unsupported-server","errorCode":null,"errorMessage":"Unsupported server","messagePattern":"Unsupported server","errorType":"exception","errorClass":"Error","httpStatus":503,"severity":"warning","filePath":"lib/routes/azurlane/news.ts","lineNumber":36,"sourceCode":"    const body: string[] = [];\n\n    for (const key in mapping) {\n        heading.push(mapping[key]);\n        separator.push(':--:');\n        body.push(key);\n    }\n\n    return [heading.join(' | '), separator.join(' | '), body.join(' | ')].map((s) => `| ${s} |`).join('\\n');\n};\n\nconst handler: Route['handler'] = async (ctx) => {\n    const { server } = ctx.req.param();\n\n    switch (server.toUpperCase()) {\n        case 'JP':\n            return await ja(ctx);\n        default:\n            throw new Error('Unsupported server');\n    }\n};\n\nconst ja: Route['handler'] = async (ctx) => {\n    const { type = '0' } = ctx.req.param();\n\n    const response = await ofetch<{ data: { rows: Array<{ id: number; content: string; title: string; publishTime: number }> } }>('https://www.azurlane.jp/api/news/list', {\n        query: {\n            type,\n            index: 1,\n            size: 15,\n        },\n    });\n\n    const list = response.data?.rows || [];\n    const items = list.map((item) => ({\n        title: item.title,\n        description: item.content,","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/azurlane/news.ts#L18-L54","documentation":"Thrown by the azurlane news route when the :server parameter (upper-cased) is not 'JP'. Only the Japanese server (ja handler hitting www.azurlane.jp) is currently implemented; any other server value falls through the switch default and is rejected.","triggerScenarios":"Calling /azurlane/news/:server with server set to CN, EN, KR, or any non-JP value; the switch's default branch executes.","commonSituations":"User assumes all Azur Lane servers are supported; outdated docs list servers that were never implemented; server code typed in wrong case is fine (toUpperCase normalizes) but a wrong code still throws.","solutions":["Use /azurlane/news/JP (or any case of jp) which is the only implemented server.","To support another server, add a case branch (e.g. case 'CN') with its handler and remove/extend the default."],"exampleFix":"// before\nswitch (server.toUpperCase()) {\n    case 'JP':\n        return await ja(ctx);\n    default:\n        throw new Error('Unsupported server');\n}\n\n// after\nconst HANDLERS = { JP: ja } as const;\nconst handler = HANDLERS[server.toUpperCase()];\nif (!handler) {\n    throw new InvalidParameterError(`Unsupported server: ${server}. Supported: ${Object.keys(HANDLERS).join(', ')}`);\n}\nreturn handler(ctx);","handlingStrategy":"validation","validationCode":"const HANDLERS = { JP: ja } as const;\nconst key = ctx.req.param('server').toUpperCase() as keyof typeof HANDLERS;\nif (!(key in HANDLERS)) {\n    throw new InvalidParameterError(`Unsupported server. Supported: ${Object.keys(HANDLERS).join(', ')}`);\n}","typeGuard":"const SUPPORTED_SERVERS = new Set(['JP']);\nfunction isSupportedServer(s: string): boolean {\n    return SUPPORTED_SERVERS.has(s.toUpperCase());\n}","tryCatchPattern":null,"preventionTips":["Drive the switch from a lookup object so the supported list and error message share one source of truth.","Document (or 4xx) rather than silently misroute unsupported servers."],"tags":["azurlane","input-validation","unsupported-feature","route-parameter"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}