648540858
2023-03-15 5fab97cf7e49636d446e063ee6e0eea80c124bd2
src/main/java/com/genersoft/iot/vmp/conf/GlobalExceptionHandler.java
@@ -32,6 +32,17 @@
        return WVPResult.fail(ErrorCode.ERROR500.getCode(), e.getMessage());
    }
    /**
     * 默认异常处理
     * @param e 异常
     * @return 统一返回结果
     */
    @ExceptionHandler(IllegalStateException.class)
    @ResponseStatus(HttpStatus.BAD_REQUEST)
    public WVPResult<String> exceptionHandler(IllegalStateException e) {
        return WVPResult.fail(ErrorCode.ERROR400);
    }
    /**
     * 自定义异常处理, 处理controller中返回的错误