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 {
79
79
console . debug ( fetchData ) ;
80
80
81
81
if ( fetchData . status !== 200 ) {
82
+ new Notice ( `MDB | Received status code ${ fetchData . status } from ${ this . apiName } .` ) ;
82
83
throw Error ( `MDB | Received status code ${ fetchData . status } from ${ this . apiName } .` ) ;
83
84
}
84
85
Original file line number Diff line number Diff line change @@ -118,16 +118,19 @@ export class OMDbAPI extends APIModel {
118
118
const fetchData = await fetch ( searchUrl ) ;
119
119
120
120
if ( fetchData . status === 401 ) {
121
+ new Notice ( `MDB | Authentication for ${ this . apiName } failed. Check the API key.` ) ;
121
122
throw Error ( `MDB | Authentication for ${ this . apiName } failed. Check the API key.` ) ;
122
123
}
123
124
if ( fetchData . status !== 200 ) {
125
+ new Notice ( `MDB | Received status code ${ fetchData . status } from ${ this . apiName } .` ) ;
124
126
throw Error ( `MDB | Received status code ${ fetchData . status } from ${ this . apiName } .` ) ;
125
127
}
126
128
127
129
const result = await fetchData . json ( ) ;
128
130
// console.debug(result);
129
131
130
132
if ( result . Response === 'False' ) {
133
+ new Notice ( `MDB | Received error from ${ this . apiName } : ${ result . Error } ` ) ;
131
134
throw Error ( `MDB | Received error from ${ this . apiName } : ${ result . Error } ` ) ;
132
135
}
133
136
You can’t perform that action at this time.
0 commit comments