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

This reverts commit f3d364122dc12f13cbfb848576a8b152849452ea.

Landed in master instead.
This commit is contained in:
Ryan Dahl 2011-03-02 22:08:44 -08:00
parent ca8be39b9e
commit fbe36a7ca9
2 changed files with 2 additions and 4 deletions

View File

@ -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 File

@ -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)) {