{"record":{"id":"179bc275a2aede05","repo":"DIYgod/RSSHub","slug":"unknown-section-type-section-type","errorCode":null,"errorMessage":"Unknown section type: ${section.type}","messagePattern":"Unknown section type: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/routes/zuvio/utils.tsx","lineNumber":45,"sourceCode":"                break;\n\n            case 'img':\n                output += renderImageSection(section);\n\n                break;\n\n            case 'youtube':\n                output += renderYouTubeSection(section);\n\n                break;\n\n            case 'link':\n                output += renderLinkSection(section);\n\n                break;\n\n            default:\n                throw new Error(`Unknown section type: ${section.type}`);\n        }\n    }\n    return output;\n};\n\nconst getBoards = () =>\n    cache.tryGet('zuvio:boards', async () => {\n        const { data } = await got(`${apiUrl}/board`, {\n            searchParams: {\n                api_token: token,\n                user_id: '0',\n            },\n        });\n\n        return data.map((item) => ({\n            title: item.name,\n            description: renderBoardLink(item.id),\n            boardId: item.id,","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/zuvio/utils.tsx#L27-L63","documentation":"Thrown at lib/routes/zuvio/utils.tsx:45 inside `renderSections` when a post section's `type` field is not one of the four handled cases: 'text', 'img', 'youtube', 'link'. The switch's default branch throws because the renderer cannot produce HTML for an unknown section type. This is a format-drift detector: Zuvio's forum API introduced a content block type the route was never updated to handle.","triggerScenarios":"Zuvio adds a new section type (e.g. 'video', 'poll', 'quote', 'gif'); a post contains an embedded widget type the route predates; the API starts returning a section with a null or empty `type` field.","commonSituations":"Zuvio forum feature update introduces new content blocks; a specific post uses a section type only added recently; API version change renames existing types.","solutions":["Inspect the failing post's raw API response to find the new `section.type` value.","Add a new `case` to the switch in renderSections with an appropriate renderer (or a skip/log for non-critical types).","If the type is non-essential, change the default branch to skip instead of throw, so one unknown section doesn't break the entire feed."],"exampleFix":"// before\ndefault:\n    throw new Error(`Unknown section type: ${section.type}`);\n\n// after (skip unknown types instead of failing the whole feed)\ndefault:\n    // unknown section types are skipped to avoid breaking the feed\n    break;","handlingStrategy":"fallback","validationCode":"const KNOWN_SECTION_TYPES = ['text', 'img', 'youtube', 'link'];\nconst isKnownSectionType = (type: string): boolean => KNOWN_SECTION_TYPES.includes(type);","typeGuard":"const isKnownZuvioSection = (section: { type?: string }): boolean =>\n    !!section.type && ['text', 'img', 'youtube', 'link'].includes(section.type);","tryCatchPattern":"try {\n    const html = renderSections(sections);\n} catch (e) {\n    if (e instanceof Error && e.message.startsWith('Unknown section type:')) {\n        // Zuvio introduced a new section type — log and skip it\n        console.warn(e.message, '— skipping unknown section');\n        const known = sections.filter((s) => isKnownZuvioSection(s));\n        return renderSections(known);\n    }\n    throw e;\n}","preventionTips":["Filter sections to known types before calling renderSections to avoid the throw.","Change the default branch to skip-and-log rather than throw so one unknown section doesn't break the entire post.","Periodically inspect Zuvio API responses for new section.type values and add renderers."],"tags":["parsing","format-change","api","zuvio"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}