map Catching
inline fun <VALUE, NEW_VALUE> Result<VALUE>.mapCatching(transform: (VALUE) -> NEW_VALUE): Result<NEW_VALUE>
Content copied to clipboard
Returns the encapsulated result of the given transform function applied to encapsulated value if this instance represents Success or the original encapsulated exception if it is Error.
Any exception thrown by transform function is caught, encapsulated as a failure and returned by this function. See map for an alternative that rethrows exceptions.