From 0de5ba008b290710da5cebe641944d992b254e6d Mon Sep 17 00:00:00 2001 From: ltctceplrm <14954927+ltctceplrm@users.noreply.github.com> Date: Mon, 17 Nov 2025 13:44:40 +0100 Subject: [PATCH] Added 401 error status --- src/api/apis/BoardGameGeekAPI.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/apis/BoardGameGeekAPI.ts b/src/api/apis/BoardGameGeekAPI.ts index e8c6500..07c2098 100644 --- a/src/api/apis/BoardGameGeekAPI.ts +++ b/src/api/apis/BoardGameGeekAPI.ts @@ -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}.`); }