Skip to content

Commit

Permalink
exposing file writable stream errors (from #316_
Browse files Browse the repository at this point in the history
thanks to #316 by @gabipetrovay, closes #469, possible fix #470 too

Co-authored-by: gabipetrovay
  • Loading branch information
tunnckoCore authored Nov 28, 2019
1 parent ba01e7e commit b2d6656
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit b2d6656

Please sign in to comment.