expectErr method

E expectErr(
  1. String message
)

Returns the held value of this Result if it is Err. Throws a ResultError with the given message and held Ok value if this Result is Ok.

See also: Rust: Result::expect_err()

Implementation

E expectErr(String message) => switch (this) {
	Ok(:T v) => throw ResultError('$message: $v', isExpected: true),
	Err(:E e) => e
};