diff --git a/lib/utils/utils.js b/lib/utils/utils.js index 7ccbc620..e32cd2f5 100644 --- a/lib/utils/utils.js +++ b/lib/utils/utils.js @@ -160,6 +160,9 @@ function downloadFile(url, dest, cb) { const o_fs = require('fs-extra'); var file = o_fs.createWriteStream(dest); (url.substring(0, 5) === 'https' ? https : http).get(url, function (response) { + if (response.statusCode !== 200) { + if (cb) cb(`Download failed, response code ${response.statusCode}`); + } response.pipe(file); file.on('finish', function () { file.close(cb);