تخطَّ إلى المحتوى

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.

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.