File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ export class MobyGamesAPI extends APIModel {
2222 console . log ( `MDB | api "${ this . apiName } " queried by Title` ) ;
2323
2424 if ( ! this . plugin . settings . MobyGamesKey ) {
25- throw Error ( `MDB | API key for ${ this . apiName } missing.` ) ;
25+ console . error ( Error ( `MDB | API key for ${ this . apiName } missing.` ) ) ;
26+ return [ ] ;
2627 }
2728
2829 const searchUrl = `${ this . apiUrl } /games?title=${ encodeURIComponent ( title ) } &api_key=${ this . plugin . settings . MobyGamesKey } ` ;
@@ -65,7 +66,7 @@ export class MobyGamesAPI extends APIModel {
6566 console . log ( `MDB | api "${ this . apiName } " queried by ID` ) ;
6667
6768 if ( ! this . plugin . settings . MobyGamesKey ) {
68- throw Error ( `MDB | API key for ${ this . apiName } missing.` ) ;
69+ console . log ( Error ( `MDB | API key for ${ this . apiName } missing.` ) ) ;
6970 }
7071
7172 const searchUrl = `${ this . apiUrl } /games?id=${ encodeURIComponent ( id ) } &api_key=${ this . plugin . settings . MobyGamesKey } ` ;
Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ export class OMDbAPI extends APIModel {
2929 console . log ( `MDB | api "${ this . apiName } " queried by Title` ) ;
3030
3131 if ( ! this . plugin . settings . OMDbKey ) {
32- throw Error ( `MDB | API key for ${ this . apiName } missing.` ) ;
32+ console . error ( Error ( `MDB | API key for ${ this . apiName } missing.` ) ) ;
33+ return [ ] ;
3334 }
3435
3536 const searchUrl = `https://www.omdbapi.com/?s=${ encodeURIComponent ( title ) } &apikey=${ this . plugin . settings . OMDbKey } ` ;
@@ -222,4 +223,4 @@ export class OMDbAPI extends APIModel {
222223
223224 return ;
224225 }
225- }
226+ }
You can’t perform that action at this time.
0 commit comments