Skip to content

Commit 08ca5e1

Browse files
committed
Use new Error construct and reverted and oversight
Forgot to revert searchbyid for Mobygames
1 parent 552e921 commit 08ca5e1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/api/apis/MobyGamesAPI.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class MobyGamesAPI extends APIModel {
2222
console.log(`MDB | api "${this.apiName}" queried by Title`);
2323

2424
if (!this.plugin.settings.MobyGamesKey) {
25-
console.error(Error(`MDB | API key for ${this.apiName} missing.`));
25+
console.error(new Error(`MDB | API key for ${this.apiName} missing.`));
2626
return [];
2727
}
2828

@@ -66,7 +66,7 @@ export class MobyGamesAPI extends APIModel {
6666
console.log(`MDB | api "${this.apiName}" queried by ID`);
6767

6868
if (!this.plugin.settings.MobyGamesKey) {
69-
console.log(Error(`MDB | API key for ${this.apiName} missing.`));
69+
throw Error(`MDB | API key for ${this.apiName} missing.`);
7070
}
7171

7272
const searchUrl = `${this.apiUrl}/games?id=${encodeURIComponent(id)}&api_key=${this.plugin.settings.MobyGamesKey}`;

src/api/apis/OMDbAPI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class OMDbAPI extends APIModel {
2929
console.log(`MDB | api "${this.apiName}" queried by Title`);
3030

3131
if (!this.plugin.settings.OMDbKey) {
32-
console.error(Error(`MDB | API key for ${this.apiName} missing.`));
32+
console.error(new Error(`MDB | API key for ${this.apiName} missing.`));
3333
return [];
3434
}
3535

0 commit comments

Comments
 (0)