getOrElse method

Success getOrElse(
  1. Success onFailure(
    1. Failure
    )
)

Implementation

Success getOrElse(Success Function(Failure) onFailure) {
  if (isSuccess) {
    return getOrThrow();
  } else {
    return onFailure(exceptionOrNull()!);
  }
}