소스 검색

持久化抛异常

wangliang 2 년 전
부모
커밋
5d290b9984
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      themis-mq/src/main/java/com/qmth/themis/mq/service/impl/MqLogicServiceImpl.java

+ 5 - 1
themis-mq/src/main/java/com/qmth/themis/mq/service/impl/MqLogicServiceImpl.java

@@ -686,7 +686,11 @@ public class MqLogicServiceImpl implements MqLogicService {
             tmRocketMessageService.saveMqMessageSuccess(mqDto, key);
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
-            throw new RuntimeException(e);
+            if (e instanceof BusinessException) {
+                throw new BusinessException(e.getMessage());
+            } else {
+                throw new RuntimeException(e);
+            }
         }
     }