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());