enhancement #I64SY6 期望能完善错误信息的提示

This commit is contained in:
everywhere.z
2022-12-07 21:01:39 +08:00
parent 940fbff68a
commit d9257392d8

View File

@@ -73,13 +73,15 @@ public class SwitchCondition extends Condition{
if (ObjectUtil.isNotNull(targetExecutor)) {
//switch的目标不能是Pre节点或者Finally节点
if (targetExecutor instanceof PreCondition || targetExecutor instanceof FinallyCondition){
String errorInfo = StrUtil.format("[{}]:switch component[{}] error, switch target node cannot be pre or finally", slot.getRequestId(), this.getSwitchNode().getInstance().getDisplayName());
String errorInfo = StrUtil.format("[{}]:switch component[{}] error, switch target node cannot be pre or finally",
slot.getRequestId(), this.getSwitchNode().getInstance().getDisplayName());
throw new SwitchTargetCannotBePreOrFinallyException(errorInfo);
}
targetExecutor.setCurrChainId(this.getCurrChainId());
targetExecutor.execute(slotIndex);
}else{
String errorInfo = StrUtil.format("[{}]:no target node find for the component[{}]", slot.getRequestId(), this.getSwitchNode().getInstance().getDisplayName());
String errorInfo = StrUtil.format("[{}]:no target node find for the component[{}],target str is [{}]",
slot.getRequestId(), this.getSwitchNode().getInstance().getDisplayName(), targetId);
throw new NoSwitchTargetNodeException(errorInfo);
}
}