mapErr<E2 extends Exception> method
Implementation
Result<T, E2> mapErr<E2 extends Exception>(E2 Function(E) onErr) {
return switch (this) {
Ok(:final T value) => Ok(value),
Err(:final E err) => Err(onErr(err)),
};
}