Use new Error construct and reverted and oversight

Forgot to revert searchbyid for Mobygames
This commit is contained in:
ltctceplrm 2024-08-22 14:46:53 +02:00
parent 552e921d53
commit 08ca5e122f
2 changed files with 3 additions and 3 deletions

View file

@ -22,7 +22,7 @@ export class MobyGamesAPI extends APIModel {
console.log(`MDB | api "${this.apiName}" queried by Title`);
if (!this.plugin.settings.MobyGamesKey) {
console.error(Error(`MDB | API key for ${this.apiName} missing.`));
console.error(new Error(`MDB | API key for ${this.apiName} missing.`));
return [];
}
@ -66,7 +66,7 @@ export class MobyGamesAPI extends APIModel {
console.log(`MDB | api "${this.apiName}" queried by ID`);
if (!this.plugin.settings.MobyGamesKey) {
console.log(Error(`MDB | API key for ${this.apiName} missing.`));
throw Error(`MDB | API key for ${this.apiName} missing.`);
}
const searchUrl = `${this.apiUrl}/games?id=${encodeURIComponent(id)}&api_key=${this.plugin.settings.MobyGamesKey}`;

View file

@ -29,7 +29,7 @@ export class OMDbAPI extends APIModel {
console.log(`MDB | api "${this.apiName}" queried by Title`);
if (!this.plugin.settings.OMDbKey) {
console.error(Error(`MDB | API key for ${this.apiName} missing.`));
console.error(new Error(`MDB | API key for ${this.apiName} missing.`));
return [];
}