diff options
author | James M Snell <jasnell@gmail.com> | 2020-02-18 20:14:50 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2020-03-05 22:52:53 +0300 |
commit | b023d61716ddc9cd97cc148bb8d237ec8d894d2b (patch) | |
tree | b4bd2099b7f4142b10019798d3a8e70c0d8abe21 /lib/internal/errors.js | |
parent | 9ec87815027ddf6782ab930975b86333a61ed554 (diff) |
lib: move isLegalPort to validators, refactor
isLegalPort was used multiple places in the same way -- to validate
the port and throw if necessary. Moved into internal/validators.
PR-URL: https://github.com/nodejs/node/pull/31851
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'lib/internal/errors.js')
-rw-r--r-- | lib/internal/errors.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/errors.js b/lib/internal/errors.js index be7385644b0..9f9a0a66f28 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -1282,7 +1282,7 @@ E('ERR_SOCKET_ALREADY_BOUND', 'Socket is already bound', Error); E('ERR_SOCKET_BAD_BUFFER_SIZE', 'Buffer size must be a positive integer', TypeError); E('ERR_SOCKET_BAD_PORT', - 'Port should be >= 0 and < 65536. Received %s.', RangeError); + '%s should be >= 0 and < 65536. Received %s.', RangeError); E('ERR_SOCKET_BAD_TYPE', 'Bad socket type specified. Valid types are: udp4, udp6', TypeError); E('ERR_SOCKET_BUFFER_SIZE', |