Skip to content

Remove throw error as! Failure TaskLocal adopts typed throws #481

Description

@kukushechkin

Swift issue swiftlang/swift#75520

The code in question:

public func withLogger<Result, Failure: Error>(
    _ logger: Logger,
    _ operation: (Logger) throws(Failure) -> Result
) throws(Failure) -> Result {
    do {
        return try Logger.withTaskLocalLogger(logger) {
            try operation(logger)
        }
    } catch {
        throw error as! Failure
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions