diff --git a/lib/internal/errors.js b/lib/internal/errors.js index 35c3fb74b08..8505ec39b68 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -878,9 +878,7 @@ E('ERR_INVALID_CHAR', invalidChar, TypeError); // This should probably be a `TypeError`. E('ERR_INVALID_CURSOR_POS', 'Cannot set cursor row without setting its column', Error); - -// This should probably be a `TypeError`. -E('ERR_INVALID_DOMAIN_NAME', 'Unable to determine the domain name', Error); +E('ERR_INVALID_DOMAIN_NAME', 'Unable to determine the domain name', TypeError); E('ERR_INVALID_FD', '"fd" must be a positive integer: %s', RangeError); E('ERR_INVALID_FD_TYPE', 'Unsupported fd type: %s', TypeError); diff --git a/test/parallel/test-http-invalid-urls.js b/test/parallel/test-http-invalid-urls.js index 9a5567aab89..0ddd72b3746 100644 --- a/test/parallel/test-http-invalid-urls.js +++ b/test/parallel/test-http-invalid-urls.js @@ -19,7 +19,10 @@ function test(host) { `${module}.${fn} should not connect to ${host}` ); const throws = () => { modules[module][fn](host, doNotCall); }; - common.expectsError(throws, { code: 'ERR_INVALID_DOMAIN_NAME' }); + common.expectsError(throws, { + type: TypeError, + code: 'ERR_INVALID_DOMAIN_NAME' + }); }); }); }