模板添加两个参数

This commit is contained in:
2025-02-19 14:36:27 +08:00
parent e87ce424fb
commit 373922bbbf
6 changed files with 21 additions and 16 deletions

View File

@ -72,15 +72,8 @@ public class CustomExceptionHandle {
*/
@ExceptionHandler(value = Exception.class)
public ApiResponse<String> handle(Exception e) {
LOGGER.error("系统异常 -> {}", e.getMessage(), e);
String requestText = getRequestAsText();
new Thread(() -> NotifyFactory.via().sendTo(
new NotifyContent(
"帧途后台报错了!",
e.getMessage() + "\n---\n请求主体\n```\n" + requestText + "\n```\n---\n错误栈\n```\n" + getStackTrace(e) + "\n```"
),
"default_user"
)).start();
LOGGER.error("系统异常 -> {}\n{}", e.getMessage(), requestText, e);
return ApiResponse.buildResult(BizCodeEnum.SERVER_UNKONWN_ERROR);
}