onFailure method
Run a side-effect on failure, then return this unchanged.
Implementation
Result<T> onFailure(void Function(NetworkException error) action) {
if (this case Failure<T>(error: final e)) action(e);
return this;
}
Run a side-effect on failure, then return this unchanged.
Result<T> onFailure(void Function(NetworkException error) action) {
if (this case Failure<T>(error: final e)) action(e);
return this;
}