From 55997f8a9f937905a1fd1f583316e57a38c16940 Mon Sep 17 00:00:00 2001 From: Benjamin Boudreau Date: Fri, 27 Feb 2015 14:06:49 -0500 Subject: [PATCH] Adding error handler on upload stream --- lib/storage-handler.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/storage-handler.js b/lib/storage-handler.js index b5bfcdf..2abd4ec 100644 --- a/lib/storage-handler.js +++ b/lib/storage-handler.js @@ -114,6 +114,10 @@ exports.upload = function (provider, req, res, options, cb) { } var writer = provider.upload(uploadParams); + writer.on('error', function(err) { + self._error(err); + }); + var endFunc = function () { self._flushing--; var values = files[part.name];