Skip to content

Commit

Permalink
errors: alter ERR_INVALID_PROTOCOL
Browse files Browse the repository at this point in the history
Changes the base instance for ERR_INVALID_PROTOCOL from Error to
TypeError as a more accurate representation of the error.

PR-URL: #19983
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
  • Loading branch information
davidmarkclements authored and jasnell committed Apr 16, 2018
1 parent a5cf3fe commit eca95a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -896,9 +896,9 @@ E('ERR_INVALID_OPT_VALUE_ENCODING',
'The value "%s" is invalid for option "encoding"', TypeError);
E('ERR_INVALID_PERFORMANCE_MARK',
'The "%s" performance mark has not been set', Error);

// This should probably be a `TypeError`.
E('ERR_INVALID_PROTOCOL', 'Protocol "%s" not supported. Expected "%s"', Error);
E('ERR_INVALID_PROTOCOL',
'Protocol "%s" not supported. Expected "%s"',
TypeError);
E('ERR_INVALID_REPL_EVAL_CONFIG',
'Cannot specify both "breakEvalOnSigint" and "eval" for REPL', TypeError);
E('ERR_INVALID_SYNC_FORK_INPUT',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ invalidUrls.forEach((invalid) => {
() => { http.request(url.parse(invalid)); },
{
code: 'ERR_INVALID_PROTOCOL',
type: Error
type: TypeError
}
);
});

0 comments on commit eca95a9

Please sign in to comment.