Skip to content

Commit b093e7d

Browse files
Rami MosheTrott
Rami Moshe
authored andcommitted
lib/https: convert to using internal/errors
1 parent 2f2f1cf commit b093e7d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/https.js

Lines changed: 2 additions & 1 deletion
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)