龚焕茏
2024-05-06 24c9d860ced4d058b866a9fb548a8ef1d1412c20
src/main/java/com/mindskip/xzs/configuration/spring/exception/ExceptionHandle.java
@@ -69,5 +69,17 @@
        return new RestResponse<>(SystemCode.ParameterValidError.getCode(), errorMsg);
    }
    @ExceptionHandler(QuestionException.class)
    @ResponseBody
    public RestResponse handler(QuestionException e) {
        logger.error(e.getMessage(), e);
        return new RestResponse<>(SystemCode.QuestionError.getCode(), SystemCode.QuestionError.getMessage());
    }
    @ExceptionHandler(RuntimeException.class)
    @ResponseBody
    public RestResponse handlerRuntimeException(RuntimeException e) {
        logger.error(e.getMessage(), e);
        return new RestResponse<>(SystemCode.InnerError.getCode(), e.getMessage());
    }
}