This commit is contained in:
mProjectsCode 2023-02-01 20:58:10 +01:00
parent 33f55f6961
commit db8a1b53c6

View file

@ -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 [];