Commit 67ccd170 by 张富康

异常报错修改

1 parent 1425b9a0
...@@ -55,7 +55,7 @@ public class GlobalExceptionHandler { ...@@ -55,7 +55,7 @@ public class GlobalExceptionHandler {
private String EXCEPTION_PUSH_URL; private String EXCEPTION_PUSH_URL;
@Value("${pushExceptionFlag: true}") @Value("${pushExceptionFlag: true}")
private Boolean pushExceptionFlag; private Boolean pushExceptionFlag;
@Value("${excludeExceptions:}") @Value("${excludeExceptions: org.springframework.web.servlet.resource.NoResourceFoundException}")
private List<String> excludeExceptionList; private List<String> excludeExceptionList;
@Resource @Resource
private Environment environment; private Environment environment;
...@@ -154,6 +154,7 @@ public class GlobalExceptionHandler { ...@@ -154,6 +154,7 @@ public class GlobalExceptionHandler {
String typeName = e.getClass().getTypeName(); String typeName = e.getClass().getTypeName();
// 可以在nacos进行配置哪些异常不发送信息 哪些异常发送信息 // 可以在nacos进行配置哪些异常不发送信息 哪些异常发送信息
// 判断异常类型是否在list中 // 判断异常类型是否在list中
excludeExceptionList.add("org.springframework.web.servlet.resource.NoResourceFoundException");
if (ObjectUtil.isNotEmpty(excludeExceptionList) && excludeExceptionList.contains(typeName)) { if (ObjectUtil.isNotEmpty(excludeExceptionList) && excludeExceptionList.contains(typeName)) {
return body; return body;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!