{"record":{"id":"f0d6d01a034eaa36","repo":"DIYgod/RSSHub","slug":"unknown-path-1-path-1","errorCode":null,"errorMessage":"Unknown path[1]: ${path[1]}","messagePattern":"Unknown path\\[1\\]: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/routes/gov/maoming/maoming.ts","lineNumber":398,"sourceCode":"                    : '#main21l_main_dkc .hei[href*=\"cgj.maoming.gov.cn\"], #main21l_main_dkc .hei[href*=\"mp.weixin.qq.com\"]';\n            list_include = 'all';\n            title_element = 'td[background=\"/global/rlyelen_line04.gif\"] > table:nth-child(1) > tbody > tr:nth-child(2)';\n            description_element = 'td[background=\"/global/rlyelen_line04.gif\"] > table:nth-child(1) > tbody > tr:nth-child(4)';\n            authorisme = '茂名市城市管理和综合执法局';\n            pubDate_element = 'td[background=\"/global/rlyelen_line04.gif\"] > table:nth-child(1) > tbody > tr:nth-child(3)';\n            pubDate_match = '发表时间：(.*)';\n            break;\n        case 'xzfw':\n            defaultPath = 'zcjd/';\n            list_element = '#lblListInfo a';\n            title_element = '.HTitle';\n            description_element = '#mmhygs';\n            authorisme = '茂名市政务服务网';\n            pubDate_element = '.HTime';\n            pubDate_match = '发布日期：(.*)   点击率';\n            break;\n        default:\n            throw new Error(`Unknown path[1]: ${path[1]}`);\n    }\n    const info = {\n        pathstartat,\n        defaultPath,\n        list_element,\n        list_include,\n        title_element,\n        title_match,\n        description_element,\n        authorisme,\n        pubDate_element,\n        pubDate_match,\n        // pubDate_format,\n    };\n    return await gdgov(info, ctx);\n}\n","sourceCodeStart":380,"sourceCodeEnd":415,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/gov/maoming/maoming.ts#L380-L415","documentation":"Thrown by the Maoming government portal route in the default case of a switch statement on path[1]. The route splits the incoming sub-path into segments and dispatches based on the second segment (path[1]), which identifies the specific government bureau/department. If no case matches, the default throws with the unrecognized path[1] value.","triggerScenarios":"A request to /gov/maoming/<path> where the second path segment doesn't match any known bureau code (www, mmny, mmswj, wgxj, wsjkj, scj, ajj, cgj, xzfw, etc.). The path is extracted via getSubPath(ctx), split by '/', and filtered for empty strings.","commonSituations":"Navigating to a Maoming government subdomain/department that isn't yet supported; typo in the bureau code; the path structure changed; using a department abbreviation that doesn't match the switch cases.","solutions":["Refer to the switch cases in maoming.ts (lines 39-398) for the complete list of supported bureau codes","Ensure the path follows the format documented in the route description: the domain prefix (e.g., 'www', 'mmny') followed by the URL path","If the bureau should be supported, add a new case to the switch statement with the appropriate selectors"],"exampleFix":"// before\ndefault:\n    throw new Error(`Unknown path[1]: ${path[1]}`);\n\n// after (use InvalidParameterError with list of valid values)\nimport InvalidParameterError from '@/errors/types/invalid-parameter';\n// ...\ndefault:\n    throw new InvalidParameterError(`Unknown bureau code '${path[1]}'. Supported: www, mmny, mmswj, wgxj, wsjkj, scj, ajj, cgj, xzfw`);","handlingStrategy":"validation","validationCode":"const KNOWN_BUREAUS = new Set(['www', 'mmny', 'mmswj', 'wgxj', 'wsjkj', 'scj', 'ajj', 'cgj', 'xzfw' /* ... */]);\nconst path = getSubPath(ctx).split('/').filter(Boolean);\nif (path.length < 2 || !KNOWN_BUREAUS.has(path[1])) {\n    throw new InvalidParameterError(`Unknown bureau '${path[1]}'. Check supported bureaus in the route source.`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Refer to the switch cases in maoming.ts for the authoritative list of bureau codes","Follow the path format documented in the route description","The first path segment is the domain prefix, the second identifies the bureau"],"tags":["validation","parameter","path-routing","government"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}