unwrapErr method

E unwrapErr()

Returns the contained Err value, consuming the this value.

Exceptions if the value is an Ok, with a custom error message provided by the Ok's value.

Implementation

E unwrapErr() => isOk
    ? throw UnwrapError(
        'called `Result#unwrapErr` on an `Ok` value',
        obj: _okValue,
      )
    : _errValue;