gcs-resumable-upload
Advanced tools
Comparing version 2.2.3 to 2.2.4
@@ -104,2 +104,3 @@ /** | ||
export interface ConfigMetadata { | ||
[key: string]: any; | ||
/** | ||
@@ -106,0 +107,0 @@ * Set the length of the file being uploaded. |
@@ -293,3 +293,7 @@ "use strict"; | ||
} | ||
reqOpts.validateStatus = () => true; | ||
// Let gaxios know we will handle a 308 error code ourselves. | ||
reqOpts.validateStatus = (status) => { | ||
return ((status >= 200 && status < 300) || | ||
status === RESUMABLE_INCOMPLETE_STATUS_CODE); | ||
}; | ||
const res = await this.authClient.request(reqOpts); | ||
@@ -299,9 +303,2 @@ if (res.data && res.data.error) { | ||
} | ||
// If no error was returned, but the response had an invalid status | ||
// code, create a new error to be passed to the callback. | ||
if ((res.status < 200 || res.status >= 300) && | ||
res.status !== RESUMABLE_INCOMPLETE_STATUS_CODE) { | ||
const e = new Error(`The request failed with a ${res.status}.`); | ||
e.code = res.status; | ||
} | ||
return res; | ||
@@ -308,0 +305,0 @@ } |
@@ -7,2 +7,9 @@ # Changelog | ||
### [2.2.4](https://www.github.com/googleapis/gcs-resumable-upload/compare/v2.2.3...v2.2.4) (2019-08-15) | ||
### Bug Fixes | ||
* let gaxios handle API errors ([#255](https://www.github.com/googleapis/gcs-resumable-upload/issues/255)) ([7a913ef](https://www.github.com/googleapis/gcs-resumable-upload/commit/7a913ef)) | ||
### [2.2.3](https://www.github.com/googleapis/gcs-resumable-upload/compare/v2.2.2...v2.2.3) (2019-07-26) | ||
@@ -9,0 +16,0 @@ |
{ | ||
"name": "gcs-resumable-upload", | ||
"version": "2.2.3", | ||
"version": "2.2.4", | ||
"description": "Upload a file to Google Cloud Storage with built-in resumable behavior", | ||
@@ -70,3 +70,3 @@ "repository": "googleapis/gcs-resumable-upload", | ||
"mockery": "^2.1.0", | ||
"nock": "^10.0.0", | ||
"nock": "^11.0.0", | ||
"sinon": "^7.3.2", | ||
@@ -73,0 +73,0 @@ "source-map-support": "^0.5.6", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55729
577