Zum Inhalt springen

Log And Rethrow (ARCH9166)

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

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

Flags catch blocks that log the error and then throw it again.

catch { logger.error("\(error)"); throw error }
catch { throw UploadError.failed(underlying: error) }

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