{"record":{"id":"d58ea5111ced48d5","repo":"DIYgod/RSSHub","slug":"unknown-type-v-type","errorCode":null,"errorMessage":"Unknown type: ${v.type}","messagePattern":"Unknown type: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/routes/dlnews/category.tsx","lineNumber":100,"sourceCode":"            } else {\n                switch (v.type) {\n                    case 'header':\n                        filteredData.push({ type: v.type, data: v.content });\n\n                        break;\n\n                    case 'list':\n                        filteredData.push({ type: v.type, list_type: v.list_type, items: v.items });\n\n                        break;\n\n                    case 'image':\n                        filteredData.push({ type: v.type, src: v.url, alt: v.alt_text, caption: v.subtitle });\n\n                        break;\n\n                    default:\n                        throw new Error(`Unknown type: ${v.type}`);\n                }\n            }\n        }\n        item.description = renderDescription(filteredData);\n        return item;\n    });\n\nexport const route: Route = {\n    path: '/:category?',\n    radar: [\n        {\n            source: ['dlnews.com/articles/:category'],\n            target: '/:category',\n        },\n    ],\n    url: 'dlnews.com/articles',\n    name: 'Latest News',\n    maintainers: ['Rjnishant530'],","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/dlnews/category.tsx#L82-L118","documentation":"The dlnews route maps each article body block by its `type`. The switch handles `list` and `image`; any other `v.type` hits `default` and throws a generic Error, which fails the whole item (and propagates out of the Promise.all). This is an internal parser-completeness gap.","triggerScenarios":"dlnews adds a new content-block type (e.g. heading, quote, embed, video, gallery) that the switch does not handle.","commonSituations":"An upstream content-model change ships new block types; the error appears only on articles that use the new blocks.","solutions":["Find the new `type` value in the API response and add a rendering case.","Return an empty string in the `default` arm as a graceful-degradation stopgap.","Add a regression test that renders a payload containing every known block type."],"exampleFix":"// before\n//   default:\n//       throw new Error(`Unknown type: ${v.type}`);\n// after\n//   default:\n//       return '';","handlingStrategy":"fallback","validationCode":"const HANDLED_BLOCK_TYPES = new Set(['list', 'image']);\nfunction isHandledBlock(v: { type: string }): boolean {\n  return HANDLED_BLOCK_TYPES.has(v.type);\n}","typeGuard":"function isHandledBlock(v: { type: string }): v is { type: 'list' | 'image' } {\n  return v.type === 'list' || v.type === 'image';\n}","tryCatchPattern":"try {\n  renderBlock(v);\n} catch {\n  // unknown block — skip it, keep the rest of the article\n}","preventionTips":["Return '' in the default arm so one unknown block does not fail the article.","Track unknown block types via telemetry.","Replay a corpus of article payloads in CI to catch new block types early."],"tags":["api","parsing","switch-default","schema-drift"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}