enhancement: #I1W8OW 提一个需求点:一个组件出错能记录一些重要信息

This commit is contained in:
bryan31
2020-10-22 21:34:56 +08:00
parent 656eea27b9
commit d5704cafe2

View File

@@ -11,6 +11,7 @@ import java.text.MessageFormat;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import cn.hutool.core.util.StrUtil;
import com.yomahub.liteflow.core.NodeComponent; import com.yomahub.liteflow.core.NodeComponent;
import com.yomahub.liteflow.entity.data.DataBus; import com.yomahub.liteflow.entity.data.DataBus;
import com.yomahub.liteflow.entity.data.Slot; import com.yomahub.liteflow.entity.data.Slot;
@@ -88,8 +89,8 @@ public class Node implements Executable{
instance.execute(); instance.execute();
if(instance.isEnd()){ if(instance.isEnd()){
LOG.info("[{}]:component[{}] lead the chain to end",slot.getRequestId(),instance.getClass().getSimpleName()); String errorInfo = StrUtil.format("[{}]:component[{}] lead the chain to end",slot.getRequestId(),instance.getClass().getSimpleName());
throw new ChainEndException("component lead the chain to end"); throw new ChainEndException(errorInfo);
} }
}else{ }else{
LOG.info("[{}]:[X]skip component[{}] execution",slot.getRequestId(),instance.getClass().getSimpleName()); LOG.info("[{}]:[X]skip component[{}] execution",slot.getRequestId(),instance.getClass().getSimpleName());