From 3751c0fe40ed22aaa281abda914ef9bf0c02edac Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 14 Dec 2012 10:49:16 -0800 Subject: [PATCH] streams2: Still emit error if there was a write() cb --- lib/_stream_writable.js | 6 ++++-- 1 file 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;