unwrapErr method

E unwrapErr()

Returns the held value of this Result if it is Err.

Warning: This method is unsafe. A ResultError will be thrown when this method is called if this Result is Ok.

See also: Rust: Result::unwrap_err()

Implementation

E unwrapErr() {
  return switch (this) {
    Ok(:T v) => throw ResultError(v),
    Err(:E e) => e,
  };
}