summaryrefslogtreecommitdiff
path: root/lib/_stream_transform.js
diff options
context:
space:
mode:
authorLuigi Pinca <luigipinca@gmail.com>2018-02-16 12:53:34 +0100
committerLuigi Pinca <luigipinca@gmail.com>2018-03-12 14:24:34 +0100
commitc9794880e89dbbecbbd85e4ee0980ed9c7ac0971 (patch)
treec1018584be54993ecf3f35e788976e56f7937b61 /lib/_stream_transform.js
parent8403f00dc3e8f1c3c5cae4c4aec2eb10733cc15c (diff)
downloadnode-new-c9794880e89dbbecbbd85e4ee0980ed9c7ac0971.tar.gz
stream: make virtual methods errors consistent
Use the same error code and always emit the error instead of throwing it. PR-URL: https://github.com/nodejs/node/pull/18813 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaƫ Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'lib/_stream_transform.js')
-rw-r--r--lib/_stream_transform.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js
index 387a39318c..679f79b80d 100644
--- a/lib/_stream_transform.js
+++ b/lib/_stream_transform.js
@@ -162,7 +162,7 @@ Transform.prototype.push = function(chunk, encoding) {
// an error, then that'll put the hurt on the whole operation. If you
// never call cb(), then you'll never get another chunk.
Transform.prototype._transform = function(chunk, encoding, cb) {
- throw new ERR_METHOD_NOT_IMPLEMENTED('_transform');
+ cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()'));
};
Transform.prototype._write = function(chunk, encoding, cb) {