summaryrefslogtreecommitdiff
path: root/lib/https.js
diff options
context:
space:
mode:
authorRami Moshe <rami.moshe@jivesoftware.com>2017-09-25 12:07:30 +0300
committerRich Trott <rtrott@gmail.com>2017-09-28 22:53:16 -0700
commit4843c2f41571088b16e673c1f996bc361ab526a6 (patch)
tree5dbddbdad45ffb4585ace0caa8a693e3b32ccf67 /lib/https.js
parentf30820fdca62da000ba7f6fc586ca1ff65e54a0f (diff)
downloadandroid-node-v8-4843c2f41571088b16e673c1f996bc361ab526a6.tar.gz
android-node-v8-4843c2f41571088b16e673c1f996bc361ab526a6.tar.bz2
android-node-v8-4843c2f41571088b16e673c1f996bc361ab526a6.zip
https: convert to using internal/errors
PR-URL: https://github.com/nodejs/node/pull/15603 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Diffstat (limited to 'lib/https.js')
-rw-r--r--lib/https.js3
1 files changed, 2 insertions, 1 deletions
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]) {