Aller au contenu

Broad Exception Catch (ARCH8153)

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

Key kotlin.logging.broad-exception-catch · Severity warning · Category logging

Flags catch (e: Exception) / catch (e: Throwable) outside top-level boundaries. Inside a coroutine ARCH8168 reports it instead, with the cancellation-specific fix.

try { load() } catch (e: Exception) { retry() }
try { load() } catch (e: IOException) { retry() }

Catch the specific exceptions the code can actually handle.