Added error handling to filestream

This would have probably rejected the promise anyway because uncaught
error, but it's better to be explicit
This commit is contained in:
Fabien O'Carroll 2019-03-13 15:24:48 +01:00
parent d40a44b9a0
commit 5e9bf5cfb5

View File

@ -108,6 +108,7 @@ module.exports.uploadZip = (options = {}) => {
return new Promise((resolve, reject) => {
fs.createReadStream(options.zipPath)
.on('error', reject)
.pipe(request.post(reqOptions, (err, res) => {
if (err) {
return reject(err);