Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3450a4c

Browse filesBrowse files
ZYSzyscodebytere
authored andcommitted
lib: gather all errors constant in the same place for consistency
PR-URL: #24038 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 965098a commit 3450a4c
Copy full SHA for 3450a4c

File tree

Expand file treeCollapse file tree

1 file changed

+15
-17
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-17
lines changed
Open diff view settings
Collapse file

‎lib/net.js‎

Copy file name to clipboardExpand all lines: lib/net.js
+15-17Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,31 +64,29 @@ const {
6464
onStreamRead,
6565
kUpdateTimer
6666
} = require('internal/stream_base_commons');
67-
const errors = require('internal/errors');
6867
const {
69-
ERR_INVALID_ADDRESS_FAMILY,
70-
ERR_INVALID_ARG_TYPE,
71-
ERR_INVALID_FD_TYPE,
72-
ERR_INVALID_IP_ADDRESS,
73-
ERR_INVALID_OPT_VALUE,
74-
ERR_SERVER_ALREADY_LISTEN,
75-
ERR_SERVER_NOT_RUNNING,
76-
ERR_SOCKET_BAD_PORT,
77-
ERR_SOCKET_CLOSED
78-
} = errors.codes;
68+
codes: {
69+
ERR_INVALID_ADDRESS_FAMILY,
70+
ERR_INVALID_ARG_TYPE,
71+
ERR_INVALID_FD_TYPE,
72+
ERR_INVALID_IP_ADDRESS,
73+
ERR_INVALID_OPT_VALUE,
74+
ERR_SERVER_ALREADY_LISTEN,
75+
ERR_SERVER_NOT_RUNNING,
76+
ERR_SOCKET_BAD_PORT,
77+
ERR_SOCKET_CLOSED
78+
},
79+
errnoException,
80+
exceptionWithHostPort,
81+
uvExceptionWithHostPort
82+
} = require('internal/errors');
7983
const { validateInt32, validateString } = require('internal/validators');
8084
const kLastWriteQueueSize = Symbol('lastWriteQueueSize');
8185

8286
// Lazy loaded to improve startup performance.
8387
let cluster;
8488
let dns;
8589

86-
const {
87-
errnoException,
88-
exceptionWithHostPort,
89-
uvExceptionWithHostPort
90-
} = errors;
91-
9290
const {
9391
kTimeout,
9492
setUnrefTimeout,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.