A class whose name ends in Exception is not a Throwable

tx0/java:exception-name-mismatchrecommendedwarningsmell

What it finds

A class named ParseException that extends nothing is not a Throwable: it cannot be thrown or caught, though every reader will take it for an exception. Either it was meant to extend Exception, or the name misleads.

From the rule's source, exception_name_mismatch.rs.

Example from the rule's tests
class ParseException {tx0 reports: ParseException is named like an exception but does not extend Throwable  String message;} class ConfigException extends RuntimeException {} class Parser {}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/java:exception-name-mismatch" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/java:exception-name-mismatch] reason="..."

tx0 explain tx0/java:exception-name-mismatch shows the same in the terminal. Found a false positive? Report it.