diff --git a/workflow-engine-server/src/main/java/cn/axzo/workflow/server/common/annotation/ReporterType.java b/workflow-engine-server/src/main/java/cn/axzo/workflow/server/common/annotation/ReporterType.java index 793ee6fc8..0ad2a3894 100644 --- a/workflow-engine-server/src/main/java/cn/axzo/workflow/server/common/annotation/ReporterType.java +++ b/workflow-engine-server/src/main/java/cn/axzo/workflow/server/common/annotation/ReporterType.java @@ -1,5 +1,6 @@ package cn.axzo.workflow.server.common.annotation; +import cn.axzo.workflow.core.common.exception.WorkflowEngineException; import cn.axzo.workflow.server.common.util.DingTalkUtils; import cn.azxo.framework.common.utils.LogUtil; import lombok.extern.slf4j.Slf4j; @@ -37,7 +38,8 @@ public enum ReporterType { if (downgrade) { log.warn("ER: {}", e.getMessage()); } else { - LogUtil.error(LogUtil.ErrorType.ERROR_BUSINESS, shortString, e.getMessage(), e); +// LogUtil.error(LogUtil.ErrorType.ERROR_BUSINESS, shortString, e.getMessage(), e); + logWarn(e, shortString); } } }, @@ -53,7 +55,7 @@ public enum ReporterType { if (downgrade) { log.warn("ER: {}", e.getMessage()); } else { - LogUtil.error(LogUtil.ErrorType.ERROR_BUSINESS, shortString, e.getMessage(), e); + logWarn(e, shortString); } } }; @@ -68,4 +70,11 @@ public enum ReporterType { */ public abstract void executeAction(String profile, String title, Boolean sendDingTalk, Object[] args, String shortString, Throwable e, Boolean downgrade); + private static void logWarn(Throwable throwable, String shortString) { + if (throwable instanceof WorkflowEngineException) { + log.warn("引擎内部正常业务异常类型,日志降级: " + throwable.getMessage(), throwable); + } else { + LogUtil.error(LogUtil.ErrorType.ERROR_BUSINESS, shortString, throwable.getMessage(), throwable); + } + } }