Inspectopedia
 
2024.3

'throw' inside 'finally' block

Warning
Last modified: 03 December 2024

Reports throw statements inside finally blocks. While occasionally intended, such throw statements can hide exceptions thrown from the try and catch blocks, thereby complicating the debugging process.

Example:

Use the Warn everywhere declared exceptions may be thrown option to warn on method calls to methods that declare exceptions as well.