mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
net: migrate errors to internal/errors
Throw ERR_SOCKET_CLOSED and ERR_SERVER_NOT_RUNNING instead of the old-style errors in net.js. PR-URL: https://github.com/nodejs/node/pull/17766 Refs: https://github.com/nodejs/node/issues/17709 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
8599465d33
commit
b98aaa312e
6 changed files with 31 additions and 13 deletions
|
@ -58,8 +58,10 @@ server.listen(common.PIPE, common.mustCall(function() {
|
|||
assert.strictEqual(res.body, 'hello world\n');
|
||||
server.close(common.mustCall(function(error) {
|
||||
assert.strictEqual(error, undefined);
|
||||
server.close(common.mustCall(function(error) {
|
||||
assert.strictEqual(error && error.message, 'Not running');
|
||||
server.close(common.expectsError({
|
||||
code: 'ERR_SERVER_NOT_RUNNING',
|
||||
message: 'Server is not running.',
|
||||
type: Error
|
||||
}));
|
||||
}));
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue