rest-client-sdk
Advanced tools
Comparing version
# Changelog | ||
## 6.6.2 | ||
Fix issue with response body already consumed when an error occured while generating token | ||
## 6.6.1 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "rest-client-sdk", | ||
"version": "6.6.1", | ||
"version": "6.6.2", | ||
"description": "Rest Client SDK for API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -181,2 +181,3 @@ /* eslint-disable camelcase */ | ||
const response = responseOrBody; | ||
const originalResponse = response.clone(); | ||
return response | ||
@@ -190,3 +191,3 @@ .json() | ||
// throw an error if response status code is an "error" status code | ||
throw getHttpErrorFromResponse(response); | ||
throw getHttpErrorFromResponse(originalResponse); | ||
} | ||
@@ -198,3 +199,6 @@ | ||
if (!(err instanceof OauthError)) { | ||
throw new OauthError(err.type, getHttpErrorFromResponse(response)); | ||
throw new OauthError( | ||
err.type, | ||
getHttpErrorFromResponse(originalResponse) | ||
); | ||
} | ||
@@ -201,0 +205,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
588077
0.11%7627
0.08%