Pattern: Throwing exception from finally
Issue: -
Throwing exceptions from a finally
block should be avoided as it can lead to confusion and discarded exceptions.
Example of incorrect code:
fun foo() {
try {
// ...
} finally {
throw IOException()
}
}