handleError method

Either<L, R> handleError(
  1. R f(
    1. L value
    )
)

Handle any error, potentially recovering from it, by mapping it to an Either value.

Applies the given function f if this is a Left and return the result wrapped in a Right, otherwise returns this if this is a Right.

Implementation

Either<L, R> handleError(R Function(L value) f) => _foldInternal(
      ifLeft: (v) => f(v).right(),
      ifRight: (v) => v.right(),
    );