Skip to content

Commit

Permalink
Handle all non 2xx status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
DordeDimitrijev committed Dec 15, 2024
1 parent 9204133 commit e151119
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/script/acquisition-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class AcquisitionManager {
return;
}

if (response.statusCode !== 200) {
if (response.statusCode < 200 || response.statusCode >= 300) {
let errorMessage: any;
this._statusCode = response.statusCode;
this.handleRequestFailure();
Expand Down Expand Up @@ -220,7 +220,7 @@ export class AcquisitionManager {
return;
}

if (response.statusCode !== 200) {
if (response.statusCode < 200 || response.statusCode >= 300) {
this._statusCode = response.statusCode;
this.handleRequestFailure();
callback(new CodePushHttpError(response.statusCode + ": " + response.body), /*not used*/ null);
Expand Down Expand Up @@ -253,7 +253,7 @@ export class AcquisitionManager {
return;
}

if (response.statusCode !== 200) {
if (response.statusCode < 200 || response.statusCode >= 300) {
this._statusCode = response.statusCode;
this.handleRequestFailure();
callback(new CodePushHttpError(response.statusCode + ": " + response.body), /*not used*/ null);
Expand Down

0 comments on commit e151119

Please sign in to comment.