diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-03-04 22:16:24 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-03-07 14:54:38 +0100 |
commit | 1d2fd8b65bacaf4401450edc8ed529106cbcfc67 (patch) | |
tree | dd6230e888c69ef3dc1b19de1ea8f9de7a81fd63 /lib/internal/streams/state.js | |
parent | cb5f9a6d871f6b2e0da8fa72dc2e91fb37ef9713 (diff) | |
download | android-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.js | 6 |
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); } } |