From 58215b015e16342df3520a9b7d548617652b3875 Mon Sep 17 00:00:00 2001 From: Liuyang <2746366019@qq.com> Date: Wed, 26 Feb 2025 13:58:11 +0800 Subject: [PATCH] =?UTF-8?q?refactor(module-llm):=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 扩展连接异常处理,增加对"Connection refused"的判断 -扩展超时异常处理,增加对"connect timed out"的判断 - 修改错误日志信息,将"后端服务"改为"算法服务" --- .../llm/service/http/FineTuningTaskHttpService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/http/FineTuningTaskHttpService.java b/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/http/FineTuningTaskHttpService.java index f99448564..c27d55229 100644 --- a/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/http/FineTuningTaskHttpService.java +++ b/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/http/FineTuningTaskHttpService.java @@ -126,11 +126,11 @@ public class FineTuningTaskHttpService { * 统一处理 HTTP 请求异常 */ private void handleHttpException(Exception e) { - if (e instanceof ConnectException) { - log.error("连接后端服务失败,请检查后端服务是否正常。"); + if (e instanceof ConnectException||StringUtils.contains(e.getMessage(), "Connection refused")) { + log.error("连接算法服务失败,请检查算法服务是否正常。"); throw exception(HTTP_CONNECTION_REFUSED); - } else if (e instanceof SocketTimeoutException) { - log.error("连接后端服务超时,请检查网络或后端服务是否正常。"); + } else if (e instanceof SocketTimeoutException || StringUtils.contains(e.getMessage(), "connect timed out")) { + log.error("连接算法服务超时,请检查网络或算法服务是否正常。"); throw exception(HTTP_CONNECTION_TIMEOUT); } else if (e instanceof IOException) { log.error("HTTP 请求发生 IO 异常: {}", e.getMessage());