Skip to content

Commit 4843c2f

Browse files
Rami MosheTrott
Rami Moshe
authored andcommitted
https: convert to using internal/errors
PR-URL: #15603 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]>
1 parent f30820f commit 4843c2f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/https.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const util = require('util');
3030
const inherits = util.inherits;
3131
const debug = util.debuglog('https');
3232
const { urlToOptions, searchParamsSymbol } = require('internal/url');
33+
const errors = require('internal/errors');
3334

3435
function Server(opts, requestListener) {
3536
if (!(this instanceof Server)) return new Server(opts, requestListener);
@@ -226,7 +227,7 @@ exports.request = function request(options, cb) {
226227
if (typeof options === 'string') {
227228
options = url.parse(options);
228229
if (!options.hostname) {
229-
throw new Error('Unable to determine the domain name');
230+
throw new errors.Error('ERR_INVALID_DOMAIN_NAME');
230231
}
231232
} else if (options && options[searchParamsSymbol] &&
232233
options[searchParamsSymbol][searchParamsSymbol]) {

0 commit comments

Comments
 (0)