From e9358af5818d87ebedf5bf1eab1ec7972041bfea Mon Sep 17 00:00:00 2001 From: Jon Moss Date: Sat, 9 Sep 2017 22:56:30 -0400 Subject: [PATCH] errors: remove duplicate error definition Also fixes error being (now!) properly thrown by alphabetize-errors. also properly enable lint rule Was not using proper magic comment syntax before! -URL: https://github.com/nodejs/node/pull/15307 Reviewed-By: Myles Borins Reviewed-By: Luigi Pinca Reviewed-By: Yuta Hiroto Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- doc/api/errors.md | 5 ----- lib/internal/errors.js | 15 ++++++++------- 2 files changed, 8 insertions(+), 12 deletions(-) mode change 100644 => 100755 lib/internal/errors.js diff --git a/doc/api/errors.md b/doc/api/errors.md index 572985d466e..8e27abec7aa 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1250,11 +1250,6 @@ Used when an attempt is made to launch a Node.js process with an unknown by errors in user code, although it is not impossible. Occurrences of this error are most likely an indication of a bug within Node.js itself. - -### ERR_VALUE_OUT_OF_RANGE - -Used when a number value is out of range. - ### ERR_V8BREAKITERATOR diff --git a/lib/internal/errors.js b/lib/internal/errors.js old mode 100644 new mode 100755 index 78f2da19a47..71d3e913651 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -1,4 +1,4 @@ -/* eslint-enable alphabetize-errors */ +/* eslint alphabetize-errors: "error" */ 'use strict'; @@ -254,15 +254,15 @@ E('ERR_REQUIRE_ESM', 'Must use import to load ES Module: %s'); E('ERR_SERVER_ALREADY_LISTEN', 'Listen method has been called more than once without closing.'); E('ERR_SOCKET_ALREADY_BOUND', 'Socket is already bound'); -E('ERR_SOCKET_BAD_PORT', 'Port should be > 0 and < 65536'); E('ERR_SOCKET_BAD_BUFFER_SIZE', 'Buffer size must be a positive integer'); +E('ERR_SOCKET_BAD_PORT', 'Port should be > 0 and < 65536'); E('ERR_SOCKET_BAD_TYPE', 'Bad socket type specified. Valid types are: udp4, udp6'); +E('ERR_SOCKET_BUFFER_SIZE', + (reason) => `Could not get or set buffer size: ${reason}`); E('ERR_SOCKET_CANNOT_SEND', 'Unable to send data'); E('ERR_SOCKET_CLOSED', 'Socket is closed'); E('ERR_SOCKET_DGRAM_NOT_RUNNING', 'Not running'); -E('ERR_SOCKET_BUFFER_SIZE', - (reason) => `Could not get or set buffer size: ${reason}`); E('ERR_STDERR_CLOSE', 'process.stderr cannot be closed'); E('ERR_STDOUT_CLOSE', 'process.stdout cannot be closed'); E('ERR_STREAM_WRAP', 'Stream has StringDecoder set or is in objectMode'); @@ -285,12 +285,13 @@ E('ERR_UNKNOWN_ENCODING', 'Unknown encoding: %s'); E('ERR_UNKNOWN_SIGNAL', 'Unknown signal: %s'); E('ERR_UNKNOWN_STDIN_TYPE', 'Unknown stdin file type'); E('ERR_UNKNOWN_STREAM_TYPE', 'Unknown stream file type'); +E('ERR_V8BREAKITERATOR', 'Full ICU data not installed. ' + + 'See https://github.com/nodejs/node/wiki/Intl'); +E('ERR_VALID_PERFORMANCE_ENTRY_TYPE', + 'At least one valid performance entry type is required'); E('ERR_VALUE_OUT_OF_RANGE', (start, end, value) => { return `The value of "${start}" must be ${end}. Received "${value}"`; }); -E('ERR_VALID_PERFORMANCE_ENTRY_TYPE', - 'At least one valid performance entry type is required'); -E('ERR_VALUE_OUT_OF_RANGE', 'The value of "%s" must be %s. Received "%s"'); function invalidArgType(name, expected, actual) { internalAssert(name, 'name is required');