Added 401 error status
This commit is contained in:
parent
51f7df2d40
commit
0de5ba008b
1 changed files with 4 additions and 0 deletions
|
|
@ -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) {
|
if (fetchData.status !== 200) {
|
||||||
throw Error(`MDB | Received status code ${fetchData.status} from ${this.apiName}.`);
|
throw Error(`MDB | Received status code ${fetchData.status} from ${this.apiName}.`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue