unwrapErr method
Returns the contained error.
Throws
Throws a StateError (with custom message msg
if provided) if this
is an Err.
Examples
// throws a `StateError`
print(const Ok<int, String>(2).unwrapErr());
// prints "error"
print(const Err<int, String>('error').unwrapErr());
Implementation
@override
@useResult
E unwrapErr({String? msg}) => error;