onErr method

Future<Result<T>> onErr(
  1. dynamic f(
    1. Error
    )
)

Calls f(result.err) with side effect if this result is Err. Anyway returns this result as is.

Implementation

Future<Result<T>> onErr(Function(Error) f) {
  return then((resultT) {
    if (resultT.isErr) {
      f(resultT.err!);
    }
    return this;
  });
}