修改异常处理上报逻辑,统计添加type20
This commit is contained in:
parent
42822f7eda
commit
1eb636d402
@ -14,6 +14,7 @@ public enum StatisticEnum {
|
|||||||
DOWNLOAD(8,"下载"),
|
DOWNLOAD(8,"下载"),
|
||||||
CLICK_ON_PAYMENT(9,"点击支付、购买"),
|
CLICK_ON_PAYMENT(9,"点击支付、购买"),
|
||||||
OTHER_ENTER(10,"其他渠道进入"),
|
OTHER_ENTER(10,"其他渠道进入"),
|
||||||
|
SCAN_MARKED_CODE(20,"扫描特殊标记码"),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -74,15 +73,14 @@ public class CustomExceptionHandle {
|
|||||||
@ExceptionHandler(value = Exception.class)
|
@ExceptionHandler(value = Exception.class)
|
||||||
public ApiResponse<String> handle(Exception e) {
|
public ApiResponse<String> handle(Exception e) {
|
||||||
LOGGER.error("系统异常 -> {}", e.getMessage(), e);
|
LOGGER.error("系统异常 -> {}", e.getMessage(), e);
|
||||||
new Thread(() -> {
|
String requestText = getRequestAsText();
|
||||||
NotifyFactory.to().sendTo(
|
new Thread(() -> NotifyFactory.via().sendTo(
|
||||||
new NotifyContent(
|
new NotifyContent(
|
||||||
"帧途后台报错了!",
|
"帧途后台报错了!",
|
||||||
e.getMessage() + "\n---\n请求主体:\n```\n" + getRequestAsText() + "\n```\n---\n错误栈:\n```\n" + getStackTrace(e) + "\n```"
|
e.getMessage() + "\n---\n请求主体:\n```\n" + requestText + "\n```\n---\n错误栈:\n```\n" + getStackTrace(e) + "\n```"
|
||||||
),
|
),
|
||||||
"default_user"
|
"default_user"
|
||||||
);
|
)).start();
|
||||||
}).start();
|
|
||||||
return ApiResponse.buildResult(BizCodeEnum.SERVER_UNKONWN_ERROR);
|
return ApiResponse.buildResult(BizCodeEnum.SERVER_UNKONWN_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user