Permalink
Browse files

Revert "Closes GH-85 Emit error rather than throwing."

This reverts commit f3d3641.

Landed in master instead.
  • Loading branch information...
1 parent ca8be39 commit fbe36a7ca963e7e2e83fc4f3e10760d74a5e42b4 @ry ry committed Mar 3, 2011
Showing with 2 additions and 4 deletions.
  1. +1 −2 lib/fs.js
  2. +1 −2 lib/tty_win32.js
View
@@ -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;
View
@@ -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)) {

0 comments on commit fbe36a7

Please sign in to comment.