From f0a47946682b93a4fb6c9246d8573ee2bc98d60e Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Mon, 24 May 2021 11:41:26 +0800 Subject: [PATCH] modify --- src/main/java/com/xcong/excoin/common/aop/ExceptionCatchAspect.java | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/xcong/excoin/common/aop/ExceptionCatchAspect.java b/src/main/java/com/xcong/excoin/common/aop/ExceptionCatchAspect.java index 1aaa265..4f838da 100644 --- a/src/main/java/com/xcong/excoin/common/aop/ExceptionCatchAspect.java +++ b/src/main/java/com/xcong/excoin/common/aop/ExceptionCatchAspect.java @@ -60,6 +60,10 @@ throw ex; } + if (profiles.equals("dev") || profiles.equals("test")) { + throw ex; + } + SysExceptionDetailEntity exceptionData = new SysExceptionDetailEntity(); String exStr = printStackTraceToString(ex); ThreadPoolUtils.EXECUTOR.execute(new Runnable(){ @@ -74,7 +78,13 @@ exceptionData.setSimpleMsg(ex.getMessage()); sysExceptionDetailDao.insert(exceptionData); - DingTalkUtils.sendMsg(profiles + "--" + ex.getMessage(), exStr.substring(0, 200), exceptionData.getId()); + String msg = ""; + if (exStr.length() > 200) { + msg = exStr.substring(0, 200); + } else { + msg = exStr; + } + DingTalkUtils.sendMsg(profiles + "--" + ex.getMessage(), msg, exceptionData.getId()); } catch (Exception e) { log.error("exception aop", e); } -- Gitblit v1.9.1