gcs-resumable-upload
Advanced tools
Comparing version 0.4.2 to 0.4.3
16
index.js
@@ -49,2 +49,3 @@ 'use strict' | ||
this.configStore = new ConfigStore('gcs-resumable-upload') | ||
this.uriProvidedManually = !!cfg.uri | ||
this.uri = cfg.uri || this.get('uri') | ||
@@ -206,3 +207,14 @@ this.numBytesWritten = 0 | ||
}, function (err, resp) { | ||
if (err) return self.destroy(err) | ||
if (err) { | ||
if (resp && resp.statusCode === 404 && !self.uriProvidedManually) { | ||
// only return the error if the user provided the resumable URI | ||
// themselves. if we're just using the configstore file to tell us that | ||
// this file exists, and it turns out that it doesn't, that's probably | ||
// stale config data. | ||
self.restart() | ||
} else { | ||
self.destroy(err) | ||
} | ||
return | ||
} | ||
@@ -227,3 +239,3 @@ if (resp.statusCode === RESUMABLE_INCOMPLETE_STATUS_CODE) { | ||
request(authorizedReqOpts, function (err, resp, body) { | ||
if (err) return callback(err) | ||
if (err) return callback(err, resp) | ||
@@ -230,0 +242,0 @@ if (body && body.error) return callback(body.error) |
{ | ||
"name": "gcs-resumable-upload", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "Upload a file to Google Cloud Storage with built-in resumable behavior", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
14004
269