{"record":{"id":"1e2e657f3838cb7e","repo":"DIYgod/RSSHub","slug":"username-does-not-exist","errorCode":null,"errorMessage":"Username does not exist","messagePattern":"Username does not exist","errorType":"exception","errorClass":"InvalidParameterError","httpStatus":503,"severity":"warning","filePath":"lib/routes/twitch/schedule.ts","lineNumber":80,"sourceCode":"                    utcOffsetMinutes: 480,\n                    startAt: today.toISOString(),\n                    endAt: oneWeekLater.toISOString(),\n                },\n                extensions: {\n                    persistedQuery: {\n                        version: 1,\n                        sha256Hash: '01925339777a81111ffac469430bc4ea4773c18a3c1642f1b231e61e2278ea41',\n                    },\n                },\n            },\n        ],\n    });\n\n    const channelShellData = response.data[0].data;\n    const streamScheduleData = response.data[1].data;\n\n    if (!streamScheduleData.user.id) {\n        throw new InvalidParameterError('Username does not exist');\n    }\n\n    const displayName = channelShellData.userOrError.displayName;\n\n    // schedule segments may be null\n    const out = streamScheduleData.user.channel.schedule.segments?.map((item) => ({\n        title: item.title,\n        guid: item.id,\n        link: `https://www.twitch.tv/${login}`,\n        author: displayName,\n        description: `StartAt: ${item.startAt}</br>EndAt: ${item.endAt}`,\n        category: item.categories.map((item) => item.name),\n    }));\n\n    return {\n        title: `Twitch - ${displayName} - Schedule`,\n        link: `https://www.twitch.tv/${login}`,\n        item: out,","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/twitch/schedule.ts#L62-L98","documentation":"InvalidParameterError from the Twitch schedule route: if the GQL `streamScheduleData.user.id` is falsy, the login does not correspond to a real Twitch user, so the route rejects it as a bad parameter rather than a server error.","triggerScenarios":"Requesting `/twitch/schedule/:login` where Twitch's schedule GQL response has no `user.id` — line 79-81 throws. The user either does not exist or has no schedule.","commonSituations":"Login typo, deleted/renamed channel, or the GQL persistedQuery hash drifted and Twitch returns an empty user object.","solutions":["Confirm the login exists at https://www.twitch.tv/{login}/schedule.","Use the correct (possibly renamed) login.","If logins are correct, verify the persistedQuery sha256Hash still matches Twitch's current operations."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!streamScheduleData?.user?.id) { throw new InvalidParameterError(`Twitch username does not exist: ${login}`); }","typeGuard":"const isScheduleUser = (u: unknown): u is { id: string } => typeof u === 'object' && u !== null && typeof (u as any).id === 'string';","tryCatchPattern":null,"preventionTips":["Validate login format up front","Track Twitch persisted-query hash changes","Treat missing user.id as a 404, not a 500"],"tags":["twitch","graphql","invalid-parameter","user-not-found","schedule"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}