{"record":{"id":"eba7a7a568520b4f","repo":"DIYgod/RSSHub","slug":"userdata-data-user-result-message-user-is-unav","errorCode":null,"errorMessage":"${userData.data.user.result.message}||User is unavailable","messagePattern":"(.+?)\\|\\|User is unavailable","errorType":"exception","errorClass":"InvalidParameterError","httpStatus":503,"severity":"warning","filePath":"lib/routes/twitter/api/web-api/api.ts","lineNumber":172,"sourceCode":"            undefined,\n            {\n                ...params,\n                listId: id,\n                count: 20,\n            },\n            ['list', 'tweets_timeline', 'timeline']\n        ),\n        ['listConversation-']\n    );\n\nconst getUser = async (id: string) => {\n    const userData: any = await getUserData(id);\n\n    if (!userData.data.user) {\n        throw new InvalidParameterError(\"This account doesn't exist\");\n    }\n    if (userData.data.user.result.__typename === 'UserUnavailable') {\n        throw new InvalidParameterError(userData.data.user.result.message || 'User is unavailable');\n    }\n\n    return {\n        profile_image_url: userData.data?.user?.result?.avatar?.image_url,\n        description: userData.data?.user?.result?.profile_bio?.description,\n        ...userData.data?.user?.result?.core,\n    };\n};\n\nconst getHomeTimeline = async (id: string, params?: Record<string, any>) =>\n    gatherLegacyFromData(\n        await paginationTweets(\n            'HomeTimeline',\n            undefined,\n            {\n                ...params,\n                count: 20,\n                includePromotedContent: true,","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/twitter/api/web-api/api.ts#L154-L190","documentation":"Dynamic InvalidParameterError thrown when userData.data.user.result.__typename === 'UserUnavailable'. Twitter sets UserUnavailable (with a message such as 'User suspended', 'User protects their tweets', or 'User has been suspended') when an account exists but is not servable; RSSHub forwards Twitter's message or falls back to 'User is unavailable'.","triggerScenarios":"The target account is suspended by Twitter, protected/locked, age-restricted, or geo-blocked for the token's region. getUser() inspects __typename and re-throws Twitter's own reason text, so the exact message varies per request.","commonSituations":"Subscribing to a feed of an account that later gets suspended; following a protected account whose owner locked it; token region is restricted from viewing the account; Twitter policy enforcement against the account.","solutions":["Read the forwarded message to identify the cause (suspended / protected / unavailable).","If protected, the token owner must be an approved follower; use a token belonging to an approved follower.","Switch to a different auth token whose region/account state can view the user.","Remove the feed; the condition is server-side and outside RSSHub's control."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isUserUnavailable(userData: any): boolean {\n  return userData?.data?.user?.result?.__typename === 'UserUnavailable';\n}","tryCatchPattern":"try { await fetchRss('/twitter/user/<handle>'); }\ncatch (e) {\n  const msg = String(e);\n  if (/suspended/i.test(msg)) { /* permanent, drop feed */ }\n  else if (/protect/i.test(msg)) { /* use an approved-follower token */ }\n  else if (/unavailable/i.test(msg)) { /* retry later */ }\n  else throw e;\n}","preventionTips":["Treat UserUnavailable as potentially transient — retry with backoff unless the message says 'suspended'.","For protected accounts, use a token owned by an approved follower.","Forward the dynamic message to your monitoring so the specific cause is visible."],"tags":["twitter","invalid-parameter","user-unavailable","suspended","dynamic-message"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}