From ad46a6c4fcc401561b231e16d8510882fbeda23c Mon Sep 17 00:00:00 2001 From: gaibu <1016771049@qq.com> Date: Fri, 14 Apr 2023 22:43:21 +0800 Subject: [PATCH] =?UTF-8?q?enhancement=20#I6URA5=20liteflow=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E8=BE=93=E5=87=BA=E4=BF=A1=E6=81=AF=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../builder/el/LiteFlowChainELBuilder.java | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/LiteFlowChainELBuilder.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/LiteFlowChainELBuilder.java index 8559c6d8b..ec9352427 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/LiteFlowChainELBuilder.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/LiteFlowChainELBuilder.java @@ -100,8 +100,7 @@ public class LiteFlowChainELBuilder { public LiteFlowChainELBuilder setChainName(String chainName) { if (FlowBus.containChain(chainName)) { this.chain = FlowBus.getChain(chainName); - } - else { + } else { this.chain.setChainName(chainName); } return this; @@ -110,8 +109,7 @@ public class LiteFlowChainELBuilder { public LiteFlowChainELBuilder setChainId(String chainId) { if (FlowBus.containChain(chainId)) { this.chain = FlowBus.getChain(chainId); - } - else { + } else { this.chain.setChainId(chainId); } return this; @@ -145,8 +143,7 @@ public class LiteFlowChainELBuilder { // 把主要的condition加入 this.conditionList.add(condition); return this; - } - catch (QLException e) { + } catch (QLException e) { // EL 底层会包装异常,这里是曲线处理 if (Objects.equals(e.getCause().getMessage(), DataNotFoundException.MSG)) { // 构建错误信息 @@ -154,9 +151,9 @@ public class LiteFlowChainELBuilder { throw new ELParseException(msg); } throw new ELParseException(e.getCause().getMessage()); - } - catch (Exception e) { - throw new ELParseException(e.getMessage()); + } catch (Exception e) { + String errMsg = StrUtil.format("parse el fail in this chain[{}];\r\n", chain.getChainId()); + throw new ELParseException(errMsg + e.getMessage()); } } @@ -169,8 +166,7 @@ public class LiteFlowChainELBuilder { try { LiteFlowChainELBuilder.createChain().setEL(elStr); return Boolean.TRUE; - } - catch (ELParseException e) { + } catch (ELParseException e) { LOG.error(e.getMessage()); } return Boolean.FALSE; @@ -249,8 +245,7 @@ public class LiteFlowChainELBuilder { } } } - } - catch (Exception ex) { + } catch (Exception ex) { // ignore } return msg;