diff options
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() { |