onError method

ApiResponse<T> onError(
  1. void callback(
    1. ApiException error
    )
)

Execute callback on error

Implementation

ApiResponse<T> onError(void Function(ApiException error) callback) {
  if (isError && error != null) {
    callback(error!);
  }
  return this;
}