HttpError.requestMixError constructor

HttpError.requestMixError({
  1. Map<String, HttpError>? httpErrorMap,
  2. bool syncRequest = false,
})

Implementation

HttpError.requestMixError(
    {Map<String, HttpError>? httpErrorMap, bool syncRequest = false}) {
  List<String> errorMsgList = [];
  if (SmartDioUtil.isNotEmpty(httpErrorMap)) {
    httpErrorMap!.forEach((url, httpError) {
      errorMsgList.add('$url :  ${httpError.message}');
    });
  }
  errorType = ViewErrorType.mixRequestError;
  message = ErrorTextConfig().getViewErrorByType(errorType);
  logMsg =
      '${syncRequest ? '同步' : '异步'}请求报错: ${_StringUtils.getTagsStr(strList: errorMsgList, tag: ',')}';
}