Aller au contenu

Throw From Finally (ARCH8155)

Ce contenu n’est pas encore disponible dans votre langue.

Key kotlin.logging.throw-from-finally · Severity error · Category logging

Flags throw inside a finally block - it masks the exception that was already propagating.

try { work() } finally { throw IllegalStateException("late") }
try { work() } finally { cleanup() }

Never throw from finally; handle cleanup failures separately.