fangyuan
2022-11-30 e9d5752c34f2bec0d44da21e0d0e6804af8945d7
ycl-common/src/main/java/com/ycl/config/ExceptionConfiguration.java
@@ -19,10 +19,12 @@
    // 捕获自定义异常数据
    @ExceptionHandler(value = ApiException.class)
    public CommonResult HandlePubException(ApiException pubExceptions) {
        System.out.println(String.format("错误:%d: %s",
                pubExceptions.getErrorCode().getCode(),
                pubExceptions.getErrorCode().getMessage()));
        return CommonResult.failed(pubExceptions.getErrorCode());
        if (pubExceptions.getErrorCode() != null) {
            System.out.println(String.format("错误:%d: %s",
                    pubExceptions.getErrorCode().getCode(),
                    pubExceptions.getErrorCode().getMessage()));
        }
        return CommonResult.failed(pubExceptions.getMessage());
    }
    @ExceptionHandler(value = MethodArgumentNotValidException.class)