From 93259980dd9683a2ffe60a359423523f07fe0da5 Mon Sep 17 00:00:00 2001 From: bryan31 Date: Fri, 11 Feb 2022 15:20:59 +0800 Subject: [PATCH] =?UTF-8?q?bug=20#I4TBDT=20=E4=BF=AE=E5=A4=8D=E5=9B=A0?= =?UTF-8?q?=E4=B8=BAChianEndException=E5=AF=BC=E8=87=B4=E7=9A=84=E7=94=A8s?= =?UTF-8?q?lot=E6=8E=A5=E5=8F=97=E6=8A=9B=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yomahub/liteflow/core/FlowExecutor.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java b/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java index d4fbff396..049522bc0 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java @@ -311,15 +311,13 @@ public class FlowExecutor { return this.execute2Resp(chainId, param, slotClazz, null, false); } - private final ArrayList> notFailExceptionList = ListUtil.toList(ChainEndException.class); - public LiteflowResponse execute2Resp(String chainId, Object param, Class slotClazz, Integer slotIndex, boolean isInnerChain) { LiteflowResponse response = new LiteflowResponse<>(); T slot = doExecute(chainId, param, slotClazz, slotIndex, isInnerChain); - if (ObjectUtil.isNotNull(slot.getException()) && !notFailExceptionList.contains(slot.getException().getClass())) { + if (ObjectUtil.isNotNull(slot.getException())) { response.setSuccess(false); response.setMessage(slot.getException().getMessage()); response.setCause(slot.getException()); @@ -377,6 +375,11 @@ public class FlowExecutor { // 执行chain chain.execute(slotIndex); + } catch (ChainEndException e) { + if (ObjectUtil.isNotNull(chain)){ + String warnMsg = StrUtil.format("[{}]:chain[{}] execute end on slot[{}]", slot.getRequestId(), chain.getChainName(), slotIndex); + LOG.warn(warnMsg); + } } catch (Exception e) { if (ObjectUtil.isNotNull(chain)){ String errMsg = StrUtil.format("[{}]:chain[{}] execute error on slot[{}]", slot.getRequestId(), chain.getChainName(), slotIndex);