Prohibited 'Exception' caught
Reports catch
clauses that catch an inappropriate exception.
Some exceptions, for example java.lang.NullPointerException
or java.lang.IllegalMonitorStateException
, represent programming errors and therefore almost certainly should not be caught in production code.
Example:
try {
return component.getMousePosition(true) != null;
} catch (NullPointerException e) { // warning: Prohibited exception 'NullPointerException' caught
return false;
}
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
ProhibitedExceptionCaught
Use the Prohibited exceptions list to specify which exceptions should be reported.
Here you can find the description of settings available for the Prohibited 'Exception' caught inspection, and the reference of their default values.
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Java, 243.23126 |
Thanks for your feedback!