HttpResponse.failure constructor

HttpResponse.failure({
  1. String? errorMsg = '网络请求失败',
  2. int? errorCode = 404,
  3. Map<String, dynamic>? response,
  4. dynamic data,
})

Implementation

HttpResponse.failure(
    {String? errorMsg = '网络请求失败',
    int? errorCode = 404,
    Map<String, dynamic>? response,
    this.data}) {
  msg = errorMsg ?? "网络请求失败";
  error = BadRequestException(message: errorMsg, code: errorCode);
  ok = false;
}