mapError<F> method

Result<T, F> mapError<F>(
  1. F transform(
    1. E error
    )
)

Transforms the error

Implementation

Result<T, F> mapError<F>(F Function(E error) transform) {
  return this is Err<T, E>
      ? Err<T, F>(transform((this as Err<T, E>).error))
      : this as Ok<T, F>;
}