summaryrefslogtreecommitdiff
path: root/lib/_stream_transform.js
diff options
context:
space:
mode:
authorsreepurnajasti <jsreepur@in.ibm.com>2017-05-30 15:09:01 -0400
committerMichael Dawson <michael_dawson@ca.ibm.com>2017-06-15 03:03:45 -0400
commitd50a802feb0b061383400e3f290ddc7410cb3a48 (patch)
treeb3ff281d2dd0c2d6f65c7c111cc0229c898f64eb /lib/_stream_transform.js
parent3c506af78b0f4e89a1c3869297ec051365d343fd (diff)
downloadnode-new-d50a802feb0b061383400e3f290ddc7410cb3a48.tar.gz
errors,stream-transform: migrate to use internal/errors.js
PR-URL: https://github.com/nodejs/node/pull/13310 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'lib/_stream_transform.js')
-rw-r--r--lib/_stream_transform.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js
index f3e83e3a24..0f607a6da3 100644
--- a/lib/_stream_transform.js
+++ b/lib/_stream_transform.js
@@ -64,7 +64,7 @@
'use strict';
module.exports = Transform;
-
+const errors = require('internal/errors');
const Duplex = require('_stream_duplex');
const util = require('util');
util.inherits(Transform, Duplex);
@@ -78,7 +78,7 @@ function afterTransform(er, data) {
if (!cb) {
return this.emit('error',
- new Error('write callback called multiple times'));
+ new errors.Error('ERR_TRANSFORM_MULTIPLE_CALLBACK'));
}
ts.writechunk = null;
@@ -210,10 +210,9 @@ function done(stream, er, data) {
// if there's nothing in the write buffer, then that means
// that nothing more will ever be provided
if (stream._writableState.length)
- throw new Error('Calling transform done when ws.length != 0');
+ throw new errors.Error('ERR_TRANSFORM_WITH_LENGTH_0');
if (stream._transformState.transforming)
- throw new Error('Calling transform done when still transforming');
-
+ throw new errors.Error('ERR_TRANSFORM_ALREADY_TRANSFORMING');
return stream.push(null);
}