From 8fed1445d810333de0bcbd2e39acba43a1479f68 Mon Sep 17 00:00:00 2001 From: wangli <274027703@qq.com> Date: Thu, 9 May 2024 10:03:19 +0800 Subject: [PATCH] =?UTF-8?q?update=20-=20=E5=B0=86=E6=9C=AC=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=B7=B2=E7=9F=A5=E7=9A=84=E5=90=84=E7=A7=8D=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E6=A0=A1=E9=AA=8C=E5=BC=82=E5=B8=B8=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=99=8D=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/common/annotation/ReporterType.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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); + } + } }