handleStatusCode method

  1. @override
void handleStatusCode(
  1. int? code, {
  2. dynamic onFail(
    1. String?,
    2. String?,
    3. Exception
    )?,
})
override

统一状态码处理

Implementation

@override
void handleStatusCode(int? code,
    {Function(String?, String?, Exception)? onFail}) {
  if (onFail != null) {
    onFail.call(
        code.toString(), null, Exception("response statusCode = $code"));
  } else {
    dealError(
        code.toString(), null, Exception("response statusCode = $code"));
  }
}