Skip to content

Commit

Permalink
lib/https: convert to using internal/errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Rami Moshe authored and Trott committed Sep 29, 2017
1 parent 2f2f1cf commit b093e7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/https.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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]) {
Expand Down

0 comments on commit b093e7d

Please sign in to comment.