unwrapErrOrElse method
Returns the contained error, if any, or the result of calculateDefaultError
otherwise.
Examples
// prints "other"
print(const Ok<int, String>(2).unwrapErrOrElse((_) => 'other'));
// prints "error"
print(const Err<int, String>('error').unwrapErrOrElse((_) => 'other'));
Implementation
@override
@useResult
E unwrapErrOrElse(E Function(T value) calculateDefaultError) => error;