You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewError('[galeforce]: The provided Riot API key is invalid or has expired. Please verify its authenticity. (sc-403)');
124
+
if(e.response.status===401){
125
+
thrownewError('[galeforce]: No Riot API key was provided. Please ensure that your key is present in your configuration file or object. (401 Unauthorized)');
126
+
}elseif(e.response.status===403){
127
+
thrownewError('[galeforce]: The provided Riot API key is invalid or has expired. Please verify its authenticity. (403 Forbidden)');
126
128
}else{
127
129
thrownewError(`[galeforce]: Data fetch failed with status code ${e.response.status}`);
it('should reject with correct error message when receiving a 404 status code',()=>expect(Galeforce.lol.summoner().region(Galeforce.regions.lol.NORTH_AMERICA).name('404').exec())
399
401
.to.eventually.be.rejectedWith('[galeforce]: Data fetch failed with status code 404'));
400
402
it('should reject with correct error message when receiving a 403 status code',()=>expect(Galeforce.lol.summoner().region(Galeforce.regions.lol.NORTH_AMERICA).name('403').exec())
401
-
.to.eventually.be.rejectedWith('[galeforce]: The provided Riot API key is invalid or has expired. Please verify its authenticity. (sc-403)'));
403
+
.to.eventually.be.rejectedWith('[galeforce]: The provided Riot API key is invalid or has expired. Please verify its authenticity. (403 Forbidden)'));
404
+
it('should reject with correct error message when receiving a 403 status code',()=>expect(Galeforce.lol.summoner().region(Galeforce.regions.lol.NORTH_AMERICA).name('401').exec())
405
+
.to.eventually.be.rejectedWith('[galeforce]: No Riot API key was provided. Please ensure that your key is present in your configuration file or object. (401 Unauthorized)'));
402
406
it('should timeout when rate limit exceeded',()=>newPromise((resolve,reject)=>{
0 commit comments