Log And Rethrow (ARCH8166)
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.
Incorrect
Section titled “Incorrect”catch (e: IOException) { log.error("x", e); throw e }Correct
Section titled “Correct”catch (e: IOException) { throw UploadException("x", e) }Either log or rethrow; wrap with context if the caller needs it.