diff --git a/lib/file.js b/lib/file.js index 50d34c09..d0043a76 100644 --- a/lib/file.js +++ b/lib/file.js @@ -31,7 +31,11 @@ module.exports = File; util.inherits(File, EventEmitter); File.prototype.open = function() { + var self = this; this._writeStream = new fs.WriteStream(this.path); + this._writeStream.on('error', function(err) { + self.emit('error', err); + }); }; File.prototype.toJSON = function() {