Inspectopedia
 
2024.3

'catch' block may ignore exception

Warning
Last modified: 03 December 2024

Reports catch blocks that are empty or may ignore an exception.

While occasionally intended, empty catch blocks may complicate debugging. Also, ignoring a catch parameter might be wrong.

The inspection won't report any catch parameters named ignore, ignored, or _.

You can use the quick-fix to change the exception name to _.

Example:

After the quick-fix is applied:

Use the Do not warn when 'catch' block contains a comment option to ignore catch blocks with comments.