enhancement #I5CBYT 框架内多次打印错误日志,希望可以关闭或调整打印次数

This commit is contained in:
everywhere.z 2022-07-14 18:46:53 +08:00
parent 84852f7a71
commit a40dc6fe84
6 changed files with 10 additions and 7 deletions

View File

@ -187,10 +187,11 @@ public class FlowExecutor {
throw new ConfigErrorException("parse error, please check liteflow config property");
}
} catch (CyclicDependencyException e) {
LOG.error(e.getMessage(), e);
LOG.error(e.getMessage());
throw e;
} catch (ChainDuplicateException e) {
LOG.error(e.getMessage());
LOG.error(e.getMessage(), e);
throw e;
} catch (Exception e) {
String errorMsg = StrUtil.format("init flow executor cause error for path {},reason: {}", rulePathList, e.getMessage());
@ -459,6 +460,8 @@ public class FlowExecutor {
if (ObjectUtil.isNotNull(chain)) {
String errMsg = StrUtil.format("[{}]:chain[{}] execute error on slot[{}]", slot.getRequestId(), chain.getChainName(), slotIndex);
LOG.error(errMsg, e);
}else{
LOG.error(e.getMessage(), e);
}
slot.setException(e);
} finally {

View File

@ -106,7 +106,7 @@ public abstract class NodeComponent{
self.onError();
}catch (Exception ex){
String errMsg = StrUtil.format("[{}]:component[{}] onError method happens exception",slot.getRequestId(),this.getDisplayName());
LOG.error(errMsg, ex);
LOG.error(errMsg);
}
throw e;
} finally {

View File

@ -183,7 +183,7 @@ public class FlowBus {
nodeMap.put(nodeId, node);
} catch (Exception e) {
String error = StrUtil.format("component[{}] register error", StrUtil.isEmpty(name)?nodeId:StrUtil.format("{}({})",nodeId,name));
LOG.error(error, e);
LOG.error(error);
throw new ComponentCannotRegisterException(error);
}
}

View File

@ -135,10 +135,10 @@ public class Node implements Executable,Cloneable{
//如果组件覆盖了isContinueOnError方法返回为true那即便出了异常也会继续流程
if (instance.isContinueOnError()) {
String errorMsg = MessageFormat.format("[{0}]:component[{1}] cause error,but flow is still go on", slot.getRequestId(),id);
LOG.error(errorMsg,e);
LOG.error(errorMsg);
} else {
String errorMsg = MessageFormat.format("[{0}]:component[{1}] cause error,error:{2}",slot.getRequestId(),id,e.getMessage());
LOG.error(errorMsg,e);
LOG.error(errorMsg);
throw e;
}
} finally {

View File

@ -130,7 +130,7 @@ public class ExecutorHelper {
return executorService;
}
}catch (Exception e){
LOG.error(e.getMessage(), e);
LOG.error(e.getMessage());
throw new ThreadExecutorServiceCreateException(e.getMessage());
}
}

View File

@ -77,7 +77,7 @@ public class LiteFlowProxyUtil {
throw new RuntimeException();
}catch (Exception e){
String errMsg = StrUtil.format("Error while proxying bean[{}]",bean.getClass().getName());
LOG.error(errMsg, e);
LOG.error(errMsg);
throw new ComponentProxyErrorException(errMsg);
}
}