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>
This commit is contained in:
Michaël Zasso 2018-02-27 14:55:32 +01:00
parent 023f49c5a9
commit 1e8d110e64
31 changed files with 377 additions and 418 deletions

View file

@ -21,7 +21,7 @@
'use strict';
const errors = require('internal/errors');
const { ERR_TLS_CERT_ALTNAME_INVALID } = require('internal/errors').codes;
const internalUtil = require('internal/util');
const internalTLS = require('internal/tls');
internalUtil.assertCrypto();
@ -224,7 +224,7 @@ exports.checkServerIdentity = function checkServerIdentity(host, cert) {
}
if (!valid) {
const err = new errors.Error('ERR_TLS_CERT_ALTNAME_INVALID', reason);
const err = new ERR_TLS_CERT_ALTNAME_INVALID(reason);
err.reason = reason;
err.host = host;
err.cert = cert;