{"record":{"id":"6e27108f7245dd41","repo":"jackwener/OpenCLI","slug":"tvmaze-returned-no-show-for-id-id","errorCode":null,"errorMessage":"TVmaze returned no show for id ${id}.","messagePattern":"TVmaze returned no show for id (.+?)\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"info","filePath":"clis/tvmaze/show.js","lineNumber":31,"sourceCode":"    access: 'read',\n    description: 'Single TVmaze TV show detail by id (network, schedule, rating, IMDB/TheTVDB cross-refs)',\n    domain: 'tvmaze.com',\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'id', positional: true, type: 'int', required: true, help: 'TVmaze show id (positive integer)' },\n    ],\n    columns: [\n        'id', 'name', 'type', 'language', 'genres', 'status',\n        'premiered', 'ended', 'runtime', 'averageRuntime', 'network',\n        'country', 'schedule', 'rating', 'imdb', 'thetvdb',\n        'officialSite', 'summary', 'url',\n    ],\n    func: async (args) => {\n        const id = requireShowId(args.id);\n        const show = await tvmazeFetch(`${TVMAZE_BASE}/shows/${id}`, `tvmaze show ${id}`);\n        if (!show || show.id == null) {\n            throw new EmptyResultError('tvmaze show', `TVmaze returned no show for id ${id}.`);\n        }\n        const network = show.network?.name ?? show.webChannel?.name ?? '';\n        const country = show.network?.country?.name ?? show.webChannel?.country?.name ?? '';\n        const days = Array.isArray(show.schedule?.days) ? show.schedule.days.join(', ') : '';\n        const time = String(show.schedule?.time ?? '').trim();\n        const schedule = days || time ? `${days}${days && time ? ' ' : ''}${time}`.trim() : '';\n        return [{\n            id: Number(show.id),\n            name: String(show.name ?? '').trim(),\n            type: String(show.type ?? '').trim(),\n            language: String(show.language ?? '').trim(),\n            genres: joinList(show.genres),\n            status: String(show.status ?? '').trim(),\n            premiered: typeof show.premiered === 'string' ? show.premiered : null,\n            ended: typeof show.ended === 'string' ? show.ended : null,\n            runtime: show.runtime == null ? null : Number(show.runtime),\n            averageRuntime: show.averageRuntime == null ? null : Number(show.averageRuntime),\n            network: String(network).trim(),","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/tvmaze/show.js#L13-L49","documentation":"This EmptyResultError is thrown when the TVmaze /shows/{id} endpoint returns a null/empty body or an object lacking an `id`, meaning no show exists for the given numeric id. The adapter validates the fetched show object after the HTTP call succeeds. It typically indicates the id does not correspond to any TVmaze show.","triggerScenarios":"Calling the `tvmaze show` command with an id (after requireShowId validation) that TVmaze has no record for — a deleted/closed show, an out-of-range id, or an id taken from a different data source.","commonSituations":"Hardcoding an id from memory or another API (e.g., using a TMDB/IMDB numeric id instead of a TVmaze id); a bookmarked TVmaze show page whose id changed; scraping ids off by one from a list index.","solutions":["Verify the id by opening https://www.tvmaze.com/shows/<id> in a browser.","Look up the show by name with `tvmaze search` and use the `show.id` from the results instead of a guessed id.","Handle EmptyResultError in calling code and fall back to a search by title.","If migrating ids from another provider, map them via TVmaze's lookup endpoints rather than assuming equality."],"exampleFix":"// before\nawait tvmazeShow(550); // TMDB Breaking Bad id, not TVmaze\n// after\nconst [match] = await tvmazeSearch('breaking bad');\nawait tvmazeShow(match.id);","handlingStrategy":"validation","validationCode":"function isTvmazeShowId(id) {\n    return Number.isInteger(id) && id > 0;\n}\n// prefer resolving ids via search:\n// const [m] = await tvmazeSearch(title); if (!m) skip; await tvmazeShow(m.id);","typeGuard":"function isPositiveInt(v) {\n    return typeof v === 'number' && Number.isInteger(v) && v > 0;\n}","tryCatchPattern":"try {\n    const show = await tvmazeShow(id);\n} catch (err) {\n    if (err instanceof EmptyResultError) {\n        // fall back to search-by-title or report unknown id\n    } else {\n        throw err;\n    }\n}","preventionTips":["Never reuse ids from TMDB/IMDB — they are not TVmaze ids","Resolve ids via tvmaze search instead of hardcoding","Validate ids are positive integers before calling","Verify a suspicious id at https://www.tvmaze.com/shows/<id>"],"tags":["empty-results","api","tvmaze","lookup"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}