stream: improve unimplemented _write() error

This commit improves the ambiguous "not implemented" error
that is provided when a writable stream does not implement
_write().

Fixes: https://github.com/nodejs/node/issues/7396
PR-URL: https://github.com/nodejs/node/pull/7671
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
ratikesh9 2016-07-12 23:17:28 +05:45 committed by cjihrig
parent 2cc01da7f0
commit 9983af0347

View File

@ -432,7 +432,7 @@ function clearBuffer(stream, state) {
}
Writable.prototype._write = function(chunk, encoding, cb) {
cb(new Error('not implemented'));
cb(new Error('_write() method is not implemented'));
};
Writable.prototype._writev = null;