Added 401 error status

This commit is contained in:
ltctceplrm 2025-11-17 13:44:40 +01:00
parent 51f7df2d40
commit 0de5ba008b

View file

@ -31,6 +31,10 @@ export class BoardGameGeekAPI extends APIModel {
},
});
if (fetchData.status === 401) {
throw Error(`MDB | Authentication for ${this.apiName} failed. Check the API key.`);
}
if (fetchData.status !== 200) {
throw Error(`MDB | Received status code ${fetchData.status} from ${this.apiName}.`);
}