From 4843c2f41571088b16e673c1f996bc361ab526a6 Mon Sep 17 00:00:00 2001 From: Rami Moshe Date: Mon, 25 Sep 2017 12:07:30 +0300 Subject: https: convert to using internal/errors PR-URL: https://github.com/nodejs/node/pull/15603 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater Reviewed-By: Fedor Indutny Reviewed-By: Yuta Hiroto --- lib/https.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/https.js') diff --git a/lib/https.js b/lib/https.js index fb22087259..ea3cf9cf27 100644 --- a/lib/https.js +++ b/lib/https.js @@ -30,6 +30,7 @@ const util = require('util'); const inherits = util.inherits; const debug = util.debuglog('https'); const { urlToOptions, searchParamsSymbol } = require('internal/url'); +const errors = require('internal/errors'); function Server(opts, requestListener) { if (!(this instanceof Server)) return new Server(opts, requestListener); @@ -226,7 +227,7 @@ exports.request = function request(options, cb) { if (typeof options === 'string') { options = url.parse(options); if (!options.hostname) { - throw new Error('Unable to determine the domain name'); + throw new errors.Error('ERR_INVALID_DOMAIN_NAME'); } } else if (options && options[searchParamsSymbol] && options[searchParamsSymbol][searchParamsSymbol]) { -- cgit v1.2.3