Skip to content

Commit

Permalink
Note in an exception message that the severity was invalid.
Browse files Browse the repository at this point in the history
Fixes external #4306

PiperOrigin-RevId: 633903875
  • Loading branch information
graememorgan authored and Error Prone Team committed May 15, 2024
1 parent 1d23d98 commit 247d927
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ private void parseSeverity(String arg) {
try {
severity = Severity.valueOf(parts.get(1));
} catch (IllegalArgumentException e) {
throw new InvalidCommandLineOptionException("invalid flag: " + arg);
throw new InvalidCommandLineOptionException(
"invalid flag: " + arg + " (" + parts.get(1) + " was not a valid severity)");
}
}
severityMap.put(checkName, severity);
Expand Down

0 comments on commit 247d927

Please sign in to comment.