Pattern: Use of return
from finally
Issue: -
Reports all return
statements in finally
blocks. Using return
statements in finally
blocks can discard and hide exceptions that are thrown in the try
block.
Example of incorrect code:
fun foo() {
try {
throw MyException()
} finally {
return // prevents MyException from being propagated
}
}