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