mapErr<W extends Object> method

  1. @override
Err<S, W> mapErr<W extends Object>(
  1. W fn(
    1. F error
    )
)
override

Returns a new Result, mapping any Err value using the given transformation.

Implementation

@override
@pragma("vm:prefer-inline")
Err<S, W> mapErr<W extends Object>(W Function(F error) fn) {
  final newError = fn(err);
  return Err(newError);
}