refactor(module-llm):优化异常处理逻辑
- 扩展连接异常处理,增加对"Connection refused"的判断 -扩展超时异常处理,增加对"connect timed out"的判断 - 修改错误日志信息,将"后端服务"改为"算法服务"
This commit is contained in:
parent
b645f86822
commit
58215b015e
@ -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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user