Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid severity could have explicit error message #4306

Open
commonquail opened this issue Mar 3, 2024 · 0 comments
Open

Invalid severity could have explicit error message #4306

commonquail opened this issue Mar 3, 2024 · 0 comments

Comments

@commonquail
Copy link

That WARN is WARN and not WARNING frequently trips me up. When a mistake like that is made the default output is something like

Fatal error compiling: invalid flag: -Xep:WildcardImport:WARNING

This is true, and Maven's -e flag does reveal the likely cause:

Caused by: com.google.errorprone.InvalidCommandLineOptionException: invalid flag: -Xep:WildcardImport:WARNING
    at com.google.errorprone.ErrorProneOptions$Builder.parseSeverity (ErrorProneOptions.java:288)
    ...

However, the implementation of ErrorProneOptions$Builder as of 2.25.0 does specifically know that the error in question is an unrecognized severity name and could say as much in the error message.

For comparison, checker names are also validated but in a different location and with a clear message (but an unclear stack trace):

Caused by: com.google.errorprone.InvalidCommandLineOptionException: wildcardimport is not a valid checker name
    at com.google.errorprone.scanner.ScannerSupplier.lambda$applyOverrides$12 (ScannerSupplier.java:201)
    at com.google.common.collect.RegularImmutableMap.forEach (RegularImmutableMap.java:297)
    at com.google.errorprone.scanner.ScannerSupplier.applyOverrides (ScannerSupplier.java:195)
    at com.google.errorprone.ErrorProneAnalyzer.lambda$scansPlugins$0 (ErrorProneAnalyzer.java:79)
    at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get (Suppliers.java:181)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant