Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors: alter ERR_INVALID_DOMAIN_NAME #19961

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,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);
Expand Down
5 changes: 4 additions & 1 deletion test/parallel/test-http-invalid-urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
});
});
});
}
Expand Down