nitaigao/gulp-s3

Errors are undetectable

toolness opened this issue · 7 comments

Hey, I noticed in the code that errors appear to be logged but then nothing is done about them:

      client.putBuffer(file.contents, uploadPath, headers, function(err, res) {
        if (err || res.statusCode !== 200) {
          gutil.log(gutil.colors.red('[FAILED]', file.path + " -> " + uploadPath));
        } else {
          gutil.log(gutil.colors.green('[SUCCESS]', file.path + " -> " + uploadPath));
          res.resume();
        }
      });

It would be nice if an error event or something was emitted, so that gulp tasks could raise errors instead of having the process exit with status code 0 even though things went amiss.

+1

+1

Fixed in: f3a4673

Thank you @nitaigao :)