瀏覽代碼

持久化抛异常

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);
+            }
         }
     }