From db8a1b53c6fd6bf700fadfe389a3d296113c38bb Mon Sep 17 00:00:00 2001 From: mProjectsCode Date: Wed, 1 Feb 2023 20:58:10 +0100 Subject: [PATCH] fix #77 --- src/api/apis/OMDbAPI.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/apis/OMDbAPI.ts b/src/api/apis/OMDbAPI.ts index 5460c7a..3b7ca30 100644 --- a/src/api/apis/OMDbAPI.ts +++ b/src/api/apis/OMDbAPI.ts @@ -40,7 +40,11 @@ export class OMDbAPI extends APIModel { const data = await fetchData.json(); if (data.Response === 'False') { - throw Error(`MDB | Received error from ${this.apiName}: ${data.Error}`); + if (data.Error === 'Movie not found!') { + return []; + } + + throw Error(`MDB | Received error from ${this.apiName}: \n${JSON.stringify(data, undefined, 4)}`); } if (!data.Search) { return [];