onFailure method
Implementation
Future<NEResult<T>> onFailure(FutureOr Function(int, String?) action) async {
return then<NEResult<T>>((value) async {
if (!value.isSuccess()) {
try {
await action(value.code, value.msg);
} catch (e, _) {
assert(() {
throw e;
}());
}
}
return value;
});
}