From b6c67ef344fe0d52047e97f8780564482872c4c9 Mon Sep 17 00:00:00 2001 From: David de Regt Date: Fri, 18 Nov 2016 17:47:07 -0800 Subject: [PATCH] 0.0.6: Fixing bug in retry logic for DoNotRetry options --- package.json | 2 +- src/SimpleWebRequest.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9627ec4..5e2a8e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simplerestclients", - "version": "0.0.5", + "version": "0.0.6", "description": "A library of components for accessing RESTful services with javascript/typescript.", "author": "David de Regt ", "scripts": { diff --git a/src/SimpleWebRequest.ts b/src/SimpleWebRequest.ts index 8de4801..af5c6ec 100644 --- a/src/SimpleWebRequest.ts +++ b/src/SimpleWebRequest.ts @@ -544,8 +544,10 @@ export class SimpleWebRequest { // Policy-adaptable failure const handleResponse = (this._options.customErrorHandler || DefaultErrorHandler)(this, errResp); - const retry = this._options.retries > 0 || handleResponse === ErrorHandlingType.RetryUncountedImmediately || - handleResponse === ErrorHandlingType.RetryUncountedWithBackoff; + const retry = handleResponse !== ErrorHandlingType.DoNotRetry && ( + this._options.retries > 0 || + handleResponse === ErrorHandlingType.RetryUncountedImmediately || + handleResponse === ErrorHandlingType.RetryUncountedWithBackoff); if (retry) { if (handleResponse === ErrorHandlingType.RetryCountedWithBackoff) {