Skip to content

Commit

Permalink
Revert "Closes nodejsGH-85 Emit error rather than throwing."
Browse files Browse the repository at this point in the history
This reverts commit f3d3641.

Landed in master instead.
  • Loading branch information
ry committed Mar 3, 2011
1 parent ca8be39 commit fbe36a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/fs.js
Expand Up @@ -1027,8 +1027,7 @@ WriteStream.prototype.flush = function() {

WriteStream.prototype.write = function(data) {
if (!this.writable) {
this.emit("error", new Error('stream not writable'));
return false;
throw new Error('stream not writable');
}

this.drainable = true;
Expand Down
3 changes: 1 addition & 2 deletions lib/tty_win32.js
Expand Up @@ -99,8 +99,7 @@ WriteStream.prototype.isTTY = true;

WriteStream.prototype.write = function(data, encoding) {
if (!this.writable) {
this.emit("error", new Error('stream not writable'));
return false;
throw new Error('stream not writable');
}

if (Buffer.isBuffer(data)) {
Expand Down

0 comments on commit fbe36a7

Please sign in to comment.