Ir al contenido

Throw From Finally (ARCH8155)

Esta página aún no está disponible en tu idioma.

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.