refactor(module-llm):优化日志打印和异常处理- 移除多余的异常信息输出,简化日志格式

- 在三个文件中调整了异常处理逻辑,避免冗余的异常包装
This commit is contained in:
Liuyang 2025-02-13 16:20:51 +08:00
parent b29ed67f92
commit 0edd7e3d11
2 changed files with 4 additions and 4 deletions

View File

@ -119,7 +119,7 @@ public class AsyncKnowledgeBase {
ragHttpService.knowledgeEmbed(ragEmbedReqVo, id);
} catch (Exception e) {
log.error("the creation of the knowledge base error : {}", e.getMessage(), e);
log.error("the creation of the knowledge base error : {}", e.getMessage());
throw e;
}
}

View File

@ -179,7 +179,7 @@ public class RagHttpService {
} catch (UnirestException e) {
throw new RuntimeException("文件上传失败: " + e.getMessage(), e);
throw new RuntimeException("文件上传失败: " + e.getMessage());
}
}
@ -346,7 +346,7 @@ public class RagHttpService {
}
} catch (JSONException e) {
log.error("{},原始响应内容: {}", JSON_PARSE_ERROR_MSG, responseBody);
throw new RuntimeException(JSON_PARSE_ERROR_MSG + ": " + e.getMessage(), e);
throw new RuntimeException(JSON_PARSE_ERROR_MSG + ": " + e.getMessage());
}
}
@ -355,7 +355,7 @@ public class RagHttpService {
*/
private void handleFailure (KnowledgeDocumentsDO documents, String errorMsg, Exception e) {
updateFileState(documents, KnowledgeStatusEnum.UPLOAD_FAILED);
log.error("{}: {}", errorMsg, e.getMessage(), e);
log.error("handleFailure {}: {}", errorMsg, e.getMessage());
throw new RuntimeException(errorMsg, e);
}