From 98e440f566479fe07b0a6d0028e3df21843c86ee Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期四, 17 六月 2021 17:21:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/test_screen' into test_screen
---
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/exceptions/GlobalExceptionCapture.java | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/exceptions/GlobalExceptionCapture.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/exceptions/GlobalExceptionCapture.java
index aa86c4b..5abcccf 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/exceptions/GlobalExceptionCapture.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/exceptions/GlobalExceptionCapture.java
@@ -35,6 +35,16 @@
}
/**
+ * 拦截捕捉自定义异常 PartyBuildingMemberException
+ * @param ex 党建异常
+ * @return 异常信息
+ */
+ @ExceptionHandler(value = PartyBuildingMemberException.class)
+ public R PartyBuildingMemberException(PartyBuildingMemberException ex) {
+ return R.fail(ex.getMsg());
+ }
+
+ /**
* 拦截捕捉自定义异常 UnAuthenticationException.class
* @param ex 认证 异常
* @return R 401
@@ -79,11 +89,11 @@
/**
*
- * @param ex 数据库异常
+ * @param ex 服务层业务异常
* @return
*/
@ExceptionHandler(value = ServiceException.class)
- public R serviceException(Exception ex) {
+ public R serviceException(ServiceException ex) {
log.error("服务层业务异常【{}】",ex.getMessage());
return R.fail(ex.getMessage());
}
--
Gitblit v1.7.1