From 7be75d8d0fe029a21cafafbbbccf840f503339eb Mon Sep 17 00:00:00 2001 From: Yaniv Friedensohn Date: Wed, 15 Aug 2018 21:22:45 +0300 Subject: [PATCH] errors: revert adding an additional error message argument to ERR_INVALID_OPT_VALUE --- lib/internal/errors.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/internal/errors.js b/lib/internal/errors.js index c2f9bea2c3bd5e..89b51a4cecc9d8 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -672,14 +672,8 @@ E('ERR_INVALID_FILE_URL_PATH', 'File URL path %s', TypeError); E('ERR_INVALID_HANDLE_TYPE', 'This handle type cannot be sent', TypeError); E('ERR_INVALID_HTTP_TOKEN', '%s must be a valid HTTP token ["%s"]', TypeError); E('ERR_INVALID_IP_ADDRESS', 'Invalid IP address: %s', TypeError); -E('ERR_INVALID_OPT_VALUE', (name, value, additionalMessage = undefined) => { - let message = `The value "${String(value)}" is invalid for option "${name}"`; - if (typeof additionalMessage === 'string' && additionalMessage.length > 0) { - message += `. ${additionalMessage}`; - } - - return message; -}, +E('ERR_INVALID_OPT_VALUE', (name, value) => + `The value "${String(value)}" is invalid for option "${name}"`, TypeError, RangeError); E('ERR_INVALID_OPT_VALUE_ENCODING',