Contents

flatMapError(_:)

Returns a new result, mapping any failure value using the given transformation and unwrapping the produced result.

Declaration

consuming func flatMapError<NewFailure>(_ transform: (Failure) -> Result<Success, NewFailure>) -> Result<Success, NewFailure> where NewFailure : Error

Parameters

  • transform:

    A closure that takes the failure value of the instance.

Return Value

A Result instance, either from the closure or the previous .success.

See Also

Transforming a Result