summaryrefslogtreecommitdiff
path: root/lib/internal/streams/state.js
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2018-03-04 22:16:24 +0100
committerMichaël Zasso <targos@protonmail.com>2018-03-07 14:54:38 +0100
commit1d2fd8b65bacaf4401450edc8ed529106cbcfc67 (patch)
treedd6230e888c69ef3dc1b19de1ea8f9de7a81fd63 /lib/internal/streams/state.js
parentcb5f9a6d871f6b2e0da8fa72dc2e91fb37ef9713 (diff)
downloadandroid-node-v8-1d2fd8b65bacaf4401450edc8ed529106cbcfc67.tar.gz
android-node-v8-1d2fd8b65bacaf4401450edc8ed529106cbcfc67.tar.bz2
android-node-v8-1d2fd8b65bacaf4401450edc8ed529106cbcfc67.zip
lib: port remaining errors to new system
PR-URL: https://github.com/nodejs/node/pull/19137 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'lib/internal/streams/state.js')
-rw-r--r--lib/internal/streams/state.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/internal/streams/state.js b/lib/internal/streams/state.js
index cca79c93de..4a1b49d25c 100644
--- a/lib/internal/streams/state.js
+++ b/lib/internal/streams/state.js
@@ -1,18 +1,18 @@
'use strict';
-const errors = require('internal/errors');
+const { ERR_INVALID_OPT_VALUE } = require('internal/errors').codes;
function getHighWaterMark(state, options, duplexKey, isDuplex) {
let hwm = options.highWaterMark;
if (hwm != null) {
if (typeof hwm !== 'number' || !(hwm >= 0))
- throw new errors.TypeError('ERR_INVALID_OPT_VALUE', 'highWaterMark', hwm);
+ throw new ERR_INVALID_OPT_VALUE('highWaterMark', hwm);
return Math.floor(hwm);
} else if (isDuplex) {
hwm = options[duplexKey];
if (hwm != null) {
if (typeof hwm !== 'number' || !(hwm >= 0))
- throw new errors.TypeError('ERR_INVALID_OPT_VALUE', duplexKey, hwm);
+ throw new ERR_INVALID_OPT_VALUE(duplexKey, hwm);
return Math.floor(hwm);
}
}