Log And Rethrow (ARCH9166)
Esta página aún no está disponible en tu idioma.
Key swift.logging.log-and-rethrow · Severity warning · Category logging
Flags catch blocks that log the error and then throw it again.
Incorrect
Section titled “Incorrect”catch { logger.error("\(error)"); throw error }Correct
Section titled “Correct”catch { throw UploadError.failed(underlying: error) }Either log or rethrow; wrap with context if the caller needs it.