Zum Inhalt springen

Throw From Finally (ARCH8155)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

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.