errors: alter ERR_INVALID_DOMAIN_NAME
Changes the base instance for ERR_INVALID_DOMAIN_NAME from Error to TypeError as a more accurate representation of the error. PR-URL: https://github.com/nodejs/node/pull/19961 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
parent
978e1524bb
commit
345e3b28c6
@ -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);
|
||||
|
@ -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'
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user