{"record":{"id":"fb76cea2efa77bd0","repo":"DIYgod/RSSHub","slug":"unknown-type-x","errorCode":null,"errorMessage":"Unknown type: ${x}","messagePattern":"Unknown type: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":503,"severity":"warning","filePath":"lib/routes/furaffinity/user.ts","lineNumber":91,"sourceCode":"    const contact_information = data.contact_information;\n    let contact_result = 'none <br> <br> ';\n    // 对一个或多个用户联系方式进行遍历\n    if (contact_information) {\n        contact_result = '';\n        for (const element of contact_information) {\n            for (const x in element) {\n                switch (x) {\n                    case 'title':\n                        contact_result += `Title: ${element[x]} <br> `;\n                        break;\n                    case 'name':\n                        contact_result += `Name: ${element[x]} <br> `;\n                        break;\n                    case 'link':\n                        contact_result += `Link: ${element[x]} <br> `;\n                        break;\n                    default:\n                        throw new Error(`Unknown type: ${x}`);\n                }\n            }\n            contact_result += '<br> ';\n        }\n    }\n\n    const description = `Name: ${name} <br> Profile: ${profile} <br> Account Type: ${account_type} <br>\n    Avatar: ${avatar} <br> Full Name: ${full_name} <br> Artist Type: ${artist_type} <br> User Title: ${user_title} <br>\n    Registered Since: ${registered_since} <br> Current Mood: ${current_mood} <br> <br> Artist Profile: <br> ${artist_profile} <br> <br>\n    Pageviews: ${pageviews} <br> Submissions: ${submissions} <br> Comments_Received: ${comments_received} <br> Comments Given: ${comments_given} <br>\n    Journals: ${journals} <br> Favorite: ${favorite} <br> <br> Artist Information: <br> Species: ${species} <br> Personal Quote: ${personal_quote} <br> Music Type/Genre: ${music_type_genre} <br>\n    Favorite Movie: ${favorites_movie} <br> Favorite Game: ${favorites_game} <br> Favorite Game Platform: ${favorites_game_platform} <br> Favorite Artist: ${favorites_artist} <br>\n    Favorite Animal: ${favorites_animal} <br> Favorite Website: ${favorites_website} <br> Favorite Food: ${favorites_food} <br> <br> Contact Information: <br> ${contact_result}\n    Watchers Count: ${watchers_count} <br> Watching Count: ${watching_count} `;\n\n    const items: Array<{ title: string; link: string; description: string }> = [\n        {\n            title: `${data.name}'s User Profile`,","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/furaffinity/user.ts#L73-L109","documentation":"When building a FurAffinity user's contact-info description block, the route iterates over the keys of each contact element and handles only three known keys: title, name, and link. Any other key in the element hits the default branch and throws. This is a defensive parser designed to surface unexpected HTML/schema changes rather than silently dropping data.","triggerScenarios":"FurAffinity adds a new contact field type (e.g. an icon, type, or label key) to its user-profile HTML, or the scraper's parsing logic mis-assigns an attribute as a key. The error message includes the unknown key name (x), making it easy to identify which new field triggered the failure.","commonSituations":"FurAffinity rolling out profile template changes that add new contact metadata; the scraping selector capturing broader elements than intended; locale-specific profile variants adding extra fields.","solutions":["Read the unknown key name (x) from the error message to learn which new field FurAffinity added.","Add a case for the new key in the switch (or a safe default that appends it generically) and redeploy.","Tighten the upstream selector so only expected contact elements are iterated.","Consider replacing the throw with a logger.warn so a single unknown key does not break the whole feed."],"exampleFix":"// before\ndefault:\n    throw new Error(`Unknown type: ${x}`);\n\n// after\ndefault:\n    logger.warn(`Unknown contact field type: ${x}`);\n    contact_result += `${x}: ${element[x]} <br> `;\n    break;","handlingStrategy":"fallback","validationCode":"const knownKeys = new Set(['title', 'name', 'link']);\n// log unknown keys instead of throwing","typeGuard":"const isKnownContactKey = (k: string): k is 'title' | 'name' | 'link' => knownKeys.has(k);","tryCatchPattern":null,"preventionTips":["Replace the throw with a logger.warn so one new field does not break the feed.\nGenerically append unknown fields rather than failing.\nAdd a regression test using a sample profile HTML fixture."],"tags":["scraping","parsing","schema-change"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}