Skip to content

Commit

Permalink
errors: revert adding an additional error message argument to ERR_INV…
Browse files Browse the repository at this point in the history
…ALID_OPT_VALUE
  • Loading branch information
yanivfriedensohn authored and Trott committed Aug 22, 2018
1 parent 20b525e commit 7be75d8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 7be75d8

Please sign in to comment.