getSuccess method

  1. @visibleForTesting
TSuccess getSuccess()

Returns the success value if the result is a success, otherwise calls orElse with the error value and returns its result.

Implementation

@visibleForTesting
TSuccess getSuccess() =>
    fold((e) => throw Failure(message: 'No success'), (r) => r);