onFailure method

NEResult<T> onFailure(
  1. void action(
    1. int,
    2. String?
    )
)

Implementation

NEResult<T> onFailure(void Function(int, String?) action) {
  if (!isSuccess()) {
    action(code, msg);
  }
  return this;
}