Skip to content

Commit 3450a4c

Browse 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

1 file changed

Lines changed: 15 additions & 17 deletions

File tree

‎lib/net.js‎

Lines 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-
consterrors=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
constkLastWriteQueueSize=Symbol('lastWriteQueueSize');
8185

8286
// Lazy loaded to improve startup performance.
8387
letcluster;
8488
letdns;
8589

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

0 commit comments

Comments
 (0)