KT.THROWING_EXCEPTION_FROM_FINALLY
Exception thrown from a finally block
This rule reports all cases where exceptions are thrown from a finally block. Throwing exceptions from a finally block should be avoided as it can lead to confusion and discarded exceptions.
Noncompliant Code
Copy
fun foo() {
try {
// ...
} finally {
throw IOException()
}
}