소스 검색

完善代理池错误处理

xuzuoyun 5 년 전
부모
커밋
6873cab344
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/HttpClientUtils.java

+ 3 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/HttpClientUtils.java

@@ -172,6 +172,7 @@ public class HttpClientUtils {
             log.info(httpClientEntity.getResult());
         } catch (Exception e) {
             e.printStackTrace();
+            return httpGetRequest(httpClientEntity);
         }
         httpClientEntity.setResult(result);
         httpClientEntity.setCookieStore(cookieStore);
@@ -240,6 +241,7 @@ public class HttpClientUtils {
         } catch (Exception e) {
             e.printStackTrace();
             log.error(e.getMessage());
+            return httpGetRequest(httpClientEntity);
         }
         httpClientEntity.setResult(result);
         httpClientEntity.setCookieStore(cookieStore);
@@ -305,6 +307,7 @@ public class HttpClientUtils {
             log.info(httpClientEntity.getResult());
         } catch (Exception e) {
             e.printStackTrace();
+            return httpGetRequest(httpClientEntity);
         }
         httpClientEntity.setCookieStore(cookieStore);
         return httpClientEntity;