From 3b65094c2dba3570ef6b439dcf1d101490e3faa9 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Sun, 5 Jan 2025 16:18:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ycwl/basic/exception/CustomExceptionHandle.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/ycwl/basic/exception/CustomExceptionHandle.java b/src/main/java/com/ycwl/basic/exception/CustomExceptionHandle.java index fbcf56d..49f2d0d 100644 --- a/src/main/java/com/ycwl/basic/exception/CustomExceptionHandle.java +++ b/src/main/java/com/ycwl/basic/exception/CustomExceptionHandle.java @@ -1,6 +1,8 @@ package com.ycwl.basic.exception; import com.ycwl.basic.enums.BizCodeEnum; +import com.ycwl.basic.notify.NotifyFactory; +import com.ycwl.basic.notify.entity.NotifyContent; import com.ycwl.basic.utils.ApiResponse; import org.apache.tomcat.util.http.fileupload.impl.SizeLimitExceededException; import org.slf4j.Logger; @@ -11,6 +13,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; /** * @date 2022年09月23日 10:19 @@ -59,6 +62,7 @@ public class CustomExceptionHandle { @ExceptionHandler(value = Exception.class) public ApiResponse handle(Exception e) { LOGGER.error("系统异常 -> {}", e.getMessage(), e); + NotifyFactory.to().send(new NotifyContent("帧途后台报错了!", e.getMessage() + "\n\n" + Arrays.toString(e.getStackTrace()))); return ApiResponse.buildResult(BizCodeEnum.SERVER_UNKONWN_ERROR); }