From e151119a72b6720817c26a4bf51da4a4488839e9 Mon Sep 17 00:00:00 2001 From: Djordje Date: Sun, 15 Dec 2024 22:07:27 +0100 Subject: [PATCH] Handle all non 2xx status codes --- src/script/acquisition-sdk.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/script/acquisition-sdk.ts b/src/script/acquisition-sdk.ts index 38038f97..b916f004 100644 --- a/src/script/acquisition-sdk.ts +++ b/src/script/acquisition-sdk.ts @@ -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(); @@ -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); @@ -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);