expectErr method

E expectErr(
  1. String msg
)

Returns the contained Err value, consuming the this value.

Throw an error if the value is an Ok, with an error message including the passed message, and the content of the Ok.

Implementation

E expectErr(String msg) =>
    isOk ? throw UnwrapError(msg, obj: _okValue) : _errValue;