-
-
Notifications
You must be signed in to change notification settings - Fork 36.6k
net: migrate errors to internal/errors #17766
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
Changes from 5 commits
0419699
614792b
9f60c2c
4f79622
37711dd
7832c2f
3cf5f8f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,10 +13,18 @@ server.listen(0, common.mustCall(function() { | |
| // Test destroy returns this, even on multiple calls when it short-circuits. | ||
| assert.strictEqual(conn, conn.destroy().destroy()); | ||
| conn.on('error', common.mustCall(function(err) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| assert.strictEqual(err.message, 'This socket is closed'); | ||
| common.expectsError({ | ||
| code: 'ERR_SOCKET_CLOSED', | ||
| message: 'Socket is closed', | ||
| type: Error | ||
| })(err); | ||
| })); | ||
| conn.write(Buffer.from('kaboom'), common.mustCall(function(err) { | ||
| assert.strictEqual(err.message, 'This socket is closed'); | ||
| common.expectsError({ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
| code: 'ERR_SOCKET_CLOSED', | ||
| message: 'Socket is closed', | ||
| type: Error | ||
| })(err); | ||
| })); | ||
| server.close(); | ||
| })); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified to...