mirror of
https://gitee.com/dromara/dax-pay
synced 2026-08-11 15:15:33 +08:00
build 3.1.0.bate2
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cn.bootx.platform</groupId>
|
||||
<artifactId>bootx-platform-common</artifactId>
|
||||
<version>3.0.0.beta5</version>
|
||||
<version>3.1.0.beta2</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>common-exception-handler</artifactId>
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ConfigurationProperties("bootx.common.exception")
|
||||
@ConfigurationProperties("bootx-platform.common.exception")
|
||||
public class ExceptionHandlerProperties {
|
||||
|
||||
/** 是否显示详细异常信息 */
|
||||
|
||||
@@ -173,7 +173,7 @@ public class RestExceptionHandler {
|
||||
@ExceptionHandler(NullPointerException.class)
|
||||
public Result<Void> handleNullPointerException(NullPointerException ex) {
|
||||
log.warn("空指针 ", ex);
|
||||
return Res.response(CommonErrorCode.SYSTEM_ERROR, "数据错误", MDC.get(CommonCode.TRACE_ID));
|
||||
return Res.response(CommonErrorCode.SYSTEM_ERROR, "空数据错误", MDC.get(CommonCode.TRACE_ID));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -204,6 +204,9 @@ public class RestExceptionHandler {
|
||||
*/
|
||||
@ExceptionHandler(Throwable.class)
|
||||
public Result<Void> handleThrowable(Throwable ex) {
|
||||
if (properties.isShowFullMessage()){
|
||||
return Res.response(CommonErrorCode.SYSTEM_ERROR, ex.getMessage(), MDC.get(CommonCode.TRACE_ID));
|
||||
}
|
||||
log.error("系统错误 {}", ex.getMessage(), ex);
|
||||
return Res.response(CommonErrorCode.SYSTEM_ERROR, "系统错误", MDC.get(CommonCode.TRACE_ID));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user