diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-02-27 14:55:32 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-03-05 19:51:30 +0100 |
commit | 1e8d110e640c658e4f6ed7540db62d063269ba6c (patch) | |
tree | afe2636b1b190fee00006beaa484fa77d5949770 /lib/crypto.js | |
parent | 023f49c5a938ef631260b76876155eaf957084be (diff) | |
download | android-node-v8-1e8d110e640c658e4f6ed7540db62d063269ba6c.tar.gz android-node-v8-1e8d110e640c658e4f6ed7540db62d063269ba6c.tar.bz2 android-node-v8-1e8d110e640c658e4f6ed7540db62d063269ba6c.zip |
lib: port errors to new system
This is a first batch of updates that touches non-underscored modules in
lib.
PR-URL: https://github.com/nodejs/node/pull/19034
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'lib/crypto.js')
-rw-r--r-- | lib/crypto.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/crypto.js b/lib/crypto.js index 0156fe6f09..d22ffea970 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -30,7 +30,10 @@ const { } = require('internal/util'); assertCrypto(); -const errors = require('internal/errors'); +const { + ERR_CRYPTO_FIPS_FORCED, + ERR_CRYPTO_FIPS_UNAVAILABLE +} = require('internal/errors').codes; const constants = process.binding('constants').crypto; const { fipsMode, @@ -183,12 +186,12 @@ module.exports = exports = { }; function setFipsDisabled() { - throw new errors.Error('ERR_CRYPTO_FIPS_UNAVAILABLE'); + throw new ERR_CRYPTO_FIPS_UNAVAILABLE(); } function setFipsForced(val) { if (val) return; - throw new errors.Error('ERR_CRYPTO_FIPS_FORCED'); + throw new ERR_CRYPTO_FIPS_FORCED(); } function getFipsDisabled() { |