unwrapErr method

E unwrapErr()

Unsafe operations that returns E or throw an Exception

Implementation

E unwrapErr() {
  return switch (this) {
    Ok(:final T value) => throw ResultUnwrapException<T, E>(value.toString()),
    Err(:final E err) => err,
  };
}