summaryrefslogtreecommitdiff
path: root/lib/_stream_writable.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-12-14 10:49:16 -0800
committerisaacs <i@izs.me>2012-12-14 17:46:23 -0800
commit3751c0fe40ed22aaa281abda914ef9bf0c02edac (patch)
treed1fe1b2499dd10219b624d29352b160c49b4bf17 /lib/_stream_writable.js
parent19ecc3a4a6ed8b7256da4425307e18dba547492d (diff)
downloadnode-3751c0fe40ed22aaa281abda914ef9bf0c02edac.tar.gz
streams2: Still emit error if there was a write() cb
Diffstat (limited to 'lib/_stream_writable.js')
-rw-r--r--lib/_stream_writable.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js
index 7364d3ab1..619603fca 100644
--- a/lib/_stream_writable.js
+++ b/lib/_stream_writable.js
@@ -175,8 +175,10 @@ function onwrite(stream, er) {
});
else
cb(er);
- } else
- stream.emit('error', er);
+ }
+
+ // backwards compatibility. still emit if there was a cb.
+ stream.emit('error', er);
return;
}
state.length -= l;