expectErr method
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;