diff --git a/check_api/src/main/java/com/google/errorprone/ErrorProneOptions.java b/check_api/src/main/java/com/google/errorprone/ErrorProneOptions.java index eb0f58f0cbf8..d91852f6bc9c 100644 --- a/check_api/src/main/java/com/google/errorprone/ErrorProneOptions.java +++ b/check_api/src/main/java/com/google/errorprone/ErrorProneOptions.java @@ -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);