diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-05-16 04:56:21 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-05-16 04:56:21 +0300 |
commit | dd602579303f5bffb1a8022c5e6aaf8b48cb13ed (patch) | |
tree | 1e20ba38fac056b11bcf4bb17dff403ab42fbc1f /lib | |
parent | 7cbddf752ad9191c70cac5544cc2d22d2bc7d5eb (diff) |
handle file.getBuffer errors
Diffstat (limited to 'lib')
-rw-r--r-- | lib/storage.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/storage.js b/lib/storage.js index 551c03b..a234365 100644 --- a/lib/storage.js +++ b/lib/storage.js @@ -286,11 +286,11 @@ File.prototype.getBlobURL = function (cb) { } /** - * TODO: detect errors and call callback with error * @param {function} cb */ File.prototype.getBuffer = function (cb) { var self = this + cb = once(cb) var buf = new Buffer(self.length) var start = 0 self.createReadStream() @@ -301,6 +301,7 @@ File.prototype.getBuffer = function (cb) { .on('end', function () { cb(null, buf) }) + .on('error', cb) } File.prototype._checkDone = function () { |