From 82f1f5d0cf1b51a5d81915e842e01760f404fa74 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期三, 20 十月 2021 13:07:16 +0800 Subject: [PATCH] update 优化xxl-job-admin相关pr代码 增加格式化日志输出与docker镜像 --- ruoyi-framework/src/main/java/com/ruoyi/framework/config/AsyncConfig.java | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/AsyncConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/AsyncConfig.java index 2eb4eb3..95f3c9b 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/AsyncConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/AsyncConfig.java @@ -1,6 +1,7 @@ package com.ruoyi.framework.config; -import com.ruoyi.common.exception.CustomException; +import cn.hutool.core.util.ArrayUtil; +import com.ruoyi.common.exception.ServiceException; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -41,10 +42,13 @@ public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { return (throwable, method, objects) -> { throwable.printStackTrace(); - throw new CustomException( - "Exception message - " + throwable.getMessage() - + ", Method name - " + method.getName() - + ", Parameter value - " + Arrays.toString(objects)); + StringBuilder sb = new StringBuilder(); + sb.append("Exception message - ").append(throwable.getMessage()) + .append(", Method name - ").append(method.getName()); + if (ArrayUtil.isNotEmpty(objects)) { + sb.append(", Parameter value - ").append(Arrays.toString(objects)); + } + throw new ServiceException(sb.toString()); }; } -- Gitblit v1.9.3