File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ export class MobyGamesAPI extends APIModel {
7979 console . debug ( fetchData ) ;
8080
8181 if ( fetchData . status !== 200 ) {
82+ new Notice ( `MDB | Received status code ${ fetchData . status } from ${ this . apiName } .` ) ;
8283 throw Error ( `MDB | Received status code ${ fetchData . status } from ${ this . apiName } .` ) ;
8384 }
8485
Original file line number Diff line number Diff line change @@ -118,16 +118,19 @@ export class OMDbAPI extends APIModel {
118118 const fetchData = await fetch ( searchUrl ) ;
119119
120120 if ( fetchData . status === 401 ) {
121+ new Notice ( `MDB | Authentication for ${ this . apiName } failed. Check the API key.` ) ;
121122 throw Error ( `MDB | Authentication for ${ this . apiName } failed. Check the API key.` ) ;
122123 }
123124 if ( fetchData . status !== 200 ) {
125+ new Notice ( `MDB | Received status code ${ fetchData . status } from ${ this . apiName } .` ) ;
124126 throw Error ( `MDB | Received status code ${ fetchData . status } from ${ this . apiName } .` ) ;
125127 }
126128
127129 const result = await fetchData . json ( ) ;
128130 // console.debug(result);
129131
130132 if ( result . Response === 'False' ) {
133+ new Notice ( `MDB | Received error from ${ this . apiName } : ${ result . Error } ` ) ;
131134 throw Error ( `MDB | Received error from ${ this . apiName } : ${ result . Error } ` ) ;
132135 }
133136
You can’t perform that action at this time.
0 commit comments