|
@@ -17,15 +17,15 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|
|
@Slf4j
|
|
|
public class CustomExceptionHandler {
|
|
|
|
|
|
- /**
|
|
|
- * 处理未知异常
|
|
|
- */
|
|
|
- @ResponseBody
|
|
|
- @ExceptionHandler(value = Exception.class)
|
|
|
- public ResultData exceptionHandler(Exception e) throws Exception {
|
|
|
- log.error("服务错误:", e);
|
|
|
- return ResultData.error( 500, "系统错误");
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 处理未知异常
|
|
|
+// */
|
|
|
+// @ResponseBody
|
|
|
+// @ExceptionHandler(value = Exception.class)
|
|
|
+// public ResultData exceptionHandler(Exception e) throws Exception {
|
|
|
+// log.error("服务错误:", e);
|
|
|
+// return ResultData.error( 500, "系统错误");
|
|
|
+// }
|
|
|
@ExceptionHandler(SaTokenException.class)
|
|
|
public ResultData handlerSaTokenException(SaTokenException e) {
|
|
|
if( NumberUtil.equals(e.getCode() , 11012)|| NumberUtil.equals(e.getCode() , 11011)) {
|
|
@@ -33,13 +33,13 @@ public class CustomExceptionHandler {
|
|
|
}
|
|
|
return ResultData.error(e.getCode(),e.getMessage());
|
|
|
}
|
|
|
- /**
|
|
|
- * 处理业务异常
|
|
|
- */
|
|
|
- @ResponseBody
|
|
|
- @ExceptionHandler(value = BusinessException.class)
|
|
|
- public ResultData businessExceptionHandler(BusinessException e) {
|
|
|
- log.warn("业务异常code:{},message:{}", e.getCode(), e.getMessage());
|
|
|
- return ResultData.error(e.getCode(), e.getMessage());
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 处理业务异常
|
|
|
+// */
|
|
|
+// @ResponseBody
|
|
|
+// @ExceptionHandler(value = BusinessException.class)
|
|
|
+// public ResultData businessExceptionHandler(BusinessException e) {
|
|
|
+// log.warn("业务异常code:{},message:{}", e.getCode(), e.getMessage());
|
|
|
+// return ResultData.error(e.getCode(), e.getMessage());
|
|
|
+// }
|
|
|
}
|