Fixed bug when API key is missing

This commit is contained in:
ltctceplrm 2024-08-22 00:22:56 +02:00
parent 265bf10426
commit 552e921d53
2 changed files with 6 additions and 4 deletions

View file

@ -29,7 +29,8 @@ export class OMDbAPI extends APIModel {
console.log(`MDB | api "${this.apiName}" queried by Title`);
if (!this.plugin.settings.OMDbKey) {
throw Error(`MDB | API key for ${this.apiName} missing.`);
console.error(Error(`MDB | API key for ${this.apiName} missing.`));
return [];
}
const searchUrl = `https://www.omdbapi.com/?s=${encodeURIComponent(title)}&apikey=${this.plugin.settings.OMDbKey}`;
@ -222,4 +223,4 @@ export class OMDbAPI extends APIModel {
return;
}
}
}