Ir al contenido

Log And Rethrow (ARCH8166)

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

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.