diff --git a/src/main/java/com/project/interaction/domain/service/impl/PostToGenerateQuestionDomainServiceImpl.java b/src/main/java/com/project/interaction/domain/service/impl/PostToGenerateQuestionDomainServiceImpl.java index a1b760b..c5291d1 100644 --- a/src/main/java/com/project/interaction/domain/service/impl/PostToGenerateQuestionDomainServiceImpl.java +++ b/src/main/java/com/project/interaction/domain/service/impl/PostToGenerateQuestionDomainServiceImpl.java @@ -97,6 +97,8 @@ public class PostToGenerateQuestionDomainServiceImpl implements PostToGenerateQu return; } + String message; + try { // 应用限流:获取令牌,超过限流速率则等待 long waitStart = System.currentTimeMillis(); @@ -115,6 +117,8 @@ public class PostToGenerateQuestionDomainServiceImpl implements PostToGenerateQu return; } + message = response != null ? response.getMessage() : "response is null"; + }catch (Exception e) { if (e instanceof WebClientResponseException exception) { int statusCode = exception.getStatusCode().value(); @@ -132,10 +136,11 @@ public class PostToGenerateQuestionDomainServiceImpl implements PostToGenerateQu return; } } + message = e.getMessage(); } - log.warn(">>> [题目生成] 调用算法服务失败, TaskId: {}", - taskId); + log.warn(">>> [题目生成] 调用算法服务失败, TaskId: {}, message: {}", + taskId,message); //消息提醒 notifyUtil.notify(taskId, clusterId);