diff options
author | ZYSzys <17367077526@163.com> | 2018-11-02 21:08:30 +0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-11-15 11:50:56 -0800 |
commit | 1ddcccb7e379089ac47b87d772343e16fd84c1c8 (patch) | |
tree | afa8e4f2417937c1a0643664a6447590c5e33543 /lib | |
parent | d4653d5a7d020b7532ddfbdc5284f3ec0d96045a (diff) | |
download | android-node-v8-1ddcccb7e379089ac47b87d772343e16fd84c1c8.tar.gz android-node-v8-1ddcccb7e379089ac47b87d772343e16fd84c1c8.tar.bz2 android-node-v8-1ddcccb7e379089ac47b87d772343e16fd84c1c8.zip |
lib: gather all errors constant in the same place for consistency
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net.js | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/lib/net.js b/lib/net.js index 503946047d..dc6312e9d9 100644 --- a/lib/net.js +++ b/lib/net.js @@ -64,19 +64,23 @@ 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'); @@ -85,12 +89,6 @@ let cluster; let dns; const { - errnoException, - exceptionWithHostPort, - uvExceptionWithHostPort -} = errors; - -const { kTimeout, setUnrefTimeout, validateTimerDuration |