mirror of
https://gitee.com/dromara/dax-pay
synced 2026-08-10 14:56:06 +08:00
feat 同步商业版代码
This commit is contained in:
@@ -15,6 +15,8 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.http.converter.HttpMessageConversionException;
|
||||
import org.springframework.validation.BindException;
|
||||
import org.springframework.web.HttpRequestMethodNotSupportedException;
|
||||
@@ -38,6 +40,7 @@ public class RestExceptionHandler {
|
||||
|
||||
private final ExceptionHandlerProperties properties;
|
||||
|
||||
|
||||
/**
|
||||
* 普通业务异常, 不需要进行堆栈跟踪
|
||||
*/
|
||||
@@ -128,12 +131,13 @@ public class RestExceptionHandler {
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求参数校验未通过
|
||||
* 页面或资源不存在
|
||||
*/
|
||||
@ExceptionHandler({ NoResourceFoundException.class })
|
||||
public Result<Void> handleBusinessException(NoResourceFoundException ex) {
|
||||
public ResponseEntity<Result<Void>> handleBusinessException(NoResourceFoundException ex) {
|
||||
log.info(ex.getMessage(), ex);
|
||||
return Res.response(CommonErrorCode.SOURCES_NOT_EXIST, "页面或资源不存在", MDC.get(CommonCode.TRACE_ID));
|
||||
Result<Void> result = Res.response(CommonErrorCode.SOURCES_NOT_EXIST, "页面或资源不存在", MDC.get(CommonCode.TRACE_ID));
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user