chore: handle not found TMDB IDs better
This commit is contained in:
parent
81d788ef84
commit
5f34be12a9
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue