报错通知
This commit is contained in:
parent
10afdb3280
commit
3b65094c2d
@ -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<String> 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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user