getOrElse method

SuccessT getOrElse(
  1. SuccessT onFailure(
    1. ResourceException
    )
)
inherited

Implementation

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