Skip to content

Commit

Permalink
lib: gather all errors constant in the same place for consistency
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ZYSzys authored and targos committed Nov 18, 2018
1 parent 692bda6 commit 6de40c4
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,32 +64,30 @@ const {
onStreamRead,
kUpdateTimer
} = require('internal/stream_base_commons');
const errors = require('internal/errors');
const {
ERR_INVALID_ADDRESS_FAMILY,
ERR_INVALID_ARG_TYPE,
ERR_INVALID_ARG_VALUE,
ERR_INVALID_FD_TYPE,
ERR_INVALID_IP_ADDRESS,
ERR_INVALID_OPT_VALUE,
ERR_SERVER_ALREADY_LISTEN,
ERR_SERVER_NOT_RUNNING,
ERR_SOCKET_BAD_PORT,
ERR_SOCKET_CLOSED
} = errors.codes;
codes: {
ERR_INVALID_ADDRESS_FAMILY,
ERR_INVALID_ARG_TYPE,
ERR_INVALID_ARG_VALUE,
ERR_INVALID_FD_TYPE,
ERR_INVALID_IP_ADDRESS,
ERR_INVALID_OPT_VALUE,
ERR_SERVER_ALREADY_LISTEN,
ERR_SERVER_NOT_RUNNING,
ERR_SOCKET_BAD_PORT,
ERR_SOCKET_CLOSED
},
errnoException,
exceptionWithHostPort,
uvExceptionWithHostPort
} = require('internal/errors');
const { validateInt32, validateString } = require('internal/validators');
const kLastWriteQueueSize = Symbol('lastWriteQueueSize');

// Lazy loaded to improve startup performance.
let cluster;
let dns;

const {
errnoException,
exceptionWithHostPort,
uvExceptionWithHostPort
} = errors;

const {
kTimeout,
setUnrefTimeout,
Expand Down

0 comments on commit 6de40c4

Please sign in to comment.