Aller au contenu

Rethrow Loses Context (ARCH9154)

Ce contenu n’est pas encore disponible dans votre langue.

Key swift.logging.rethrow-loses-stack-trace · Severity warning · Category logging

Flags throwing a new error inside a catch block without carrying the caught error.

catch { throw RepositoryError.loadFailed }
catch { throw RepositoryError.loadFailed(underlying: error) }

Wrap the original error so the cause survives.