uploader-for-google-drive-resumable-upload-url
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -30,5 +30,5 @@ // Copyright 2017- Paul Brewer, Economic and Financial Technology Consulting LLC | ||
}; | ||
return new Promise(function (resolve) { | ||
return new Promise(function (resolve, reject) { | ||
const uploadRequest = request(driveupload, (err, response, body) => { | ||
if (err) throw new Error("upload error code: "+(response && response.statusCode)+" "+err); | ||
if (err) return reject(new Error("upload error code: "+(response && response.statusCode)+" "+err)); | ||
let result; | ||
@@ -46,3 +46,3 @@ if (typeof(body) === 'string') { | ||
if (md5 !== result.md5Checksum) { | ||
throw new Error('bad md5 checksum on upload to Google Drive:', JSON.stringify(result)); | ||
return reject(new Error('bad md5 checksum on upload to Google Drive:', JSON.stringify(result))); | ||
} | ||
@@ -49,0 +49,0 @@ } |
{ | ||
"name": "uploader-for-google-drive-resumable-upload-url", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "uploader for Resumable Upload urls from Google Drive API v3", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
15202