map Failure
infix inline fun <Ok, ErrorIn, ErrorOut> Outcome<Ok, ErrorIn>.mapFailure(transform: (ErrorIn) -> ErrorOut): Outcome<Ok, ErrorOut>
Transforms Outcome<Ok, ErrorIn> into Outcome<Ok, ErrorOut> by applying transform to the Failure error.
Success outcomes pass through; the
Okis re-wrapped to satisfyErrorOut.Unlike flatMapFailure, transform returns a plain value — it is automatically wrapped in Failure.
No error handling is provided.
Parameters
See also
inline fun <Ok, ErrorIn, ErrorOut> OutcomeFlow<Ok, ErrorIn>.mapFailure(crossinline transform: suspend (ErrorIn) -> ErrorOut): OutcomeFlow<Ok, ErrorOut>
Returns a new OutcomeFlow with each Failure error transformed by transform. Success outcomes pass through unaffected.