Skip to content

Commit fbe36a7

Browse files
committed
Revert "Closes GH-85 Emit error rather than throwing."
This reverts commit f3d3641. Landed in master instead.
1 parent ca8be39 commit fbe36a7

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/fs.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1027,8 +1027,7 @@ WriteStream.prototype.flush = function() {
10271027

10281028
WriteStream.prototype.write = function(data) {
10291029
if (!this.writable) {
1030-
this.emit("error", new Error('stream not writable'));
1031-
return false;
1030+
throw new Error('stream not writable');
10321031
}
10331032

10341033
this.drainable = true;

lib/tty_win32.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ WriteStream.prototype.isTTY = true;
9999

100100
WriteStream.prototype.write = function(data, encoding) {
101101
if (!this.writable) {
102-
this.emit("error", new Error('stream not writable'));
103-
return false;
102+
throw new Error('stream not writable');
104103
}
105104

106105
if (Buffer.isBuffer(data)) {

0 commit comments

Comments
 (0)