From 5f34be12a9d08eb1096a0a1fbe63f3c1494fc589 Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Sat, 14 Jun 2025 18:00:55 +0000 Subject: [PATCH] chore: handle not found TMDB IDs better --- src/utils/tmdb.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/tmdb.ts b/src/utils/tmdb.ts index afddb47..4838086 100644 --- a/src/utils/tmdb.ts +++ b/src/utils/tmdb.ts @@ -2,6 +2,7 @@ import { ImdbId, TmdbId } from './id'; import { Context } from '../types'; import { Fetcher } from './Fetcher'; import { envGet } from './env'; +import { NotFoundError } from '../error'; interface FindResponsePartial { movie_results: { @@ -51,7 +52,7 @@ export const getTmdbIdFromImdbId = async (ctx: Context, fetcher: Fetcher, imdbId const id = (imdbId.season ? response.tv_results[0] : response.movie_results[0])?.id; if (!id) { - throw new Error(`Could not get TMDB ID of IMDb ID "${imdbId.id}"`); + throw new NotFoundError(`Could not get TMDB ID of IMDb ID "${imdbId.id}"`); } imdbTmdbMap.set(imdbId.id, id);