Zum Inhalt springen

Log And Rethrow (ARCH8166)

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

Key kotlin.logging.log-and-rethrow · Severity warning · Category logging

Flags catch blocks that log the exception and then throw it again - it will be logged once more by whoever catches it next.

catch (e: IOException) { log.error("x", e); throw e }
catch (e: IOException) { throw UploadException("x", e) }

Either log or rethrow; wrap with context if the caller needs it.