onFailure method
Executes the given function with the error if this is a failure
Implementation
Result<T, E> onFailure(void Function(E) action) {
if (this case Failure(error: final error)) {
action(error);
}
return this;
}
Executes the given function with the error if this is a failure
Result<T, E> onFailure(void Function(E) action) {
if (this case Failure(error: final error)) {
action(error);
}
return this;
}