From 54b3ad9a7c548929de1c3b172c0f3a57004b4b6b Mon Sep 17 00:00:00 2001 From: xuyang <748613696@qq.com> Date: Mon, 4 Sep 2023 11:26:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../njcn/web/exception/GlobalBusinessExceptionHandler.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pqs-common/common-web/src/main/java/com/njcn/web/exception/GlobalBusinessExceptionHandler.java b/pqs-common/common-web/src/main/java/com/njcn/web/exception/GlobalBusinessExceptionHandler.java index 2e19c117f..122b3fdda 100644 --- a/pqs-common/common-web/src/main/java/com/njcn/web/exception/GlobalBusinessExceptionHandler.java +++ b/pqs-common/common-web/src/main/java/com/njcn/web/exception/GlobalBusinessExceptionHandler.java @@ -232,8 +232,10 @@ public class GlobalBusinessExceptionHandler { logService.recodeBusinessExceptionLog(tempException, httpServletRequest, exceptionCause); //判断方法上是否有自定义注解,做特殊处理 Method method = ReflectCommonUtil.getMethod(exception); - if(method.isAnnotationPresent(ReturnMsg.class)){ - return HttpResultUtil.assembleResult(code, null, StrFormatter.format("{}",exceptionCause)); + if (!Objects.isNull(method)){ + if(method.isAnnotationPresent(ReturnMsg.class)){ + return HttpResultUtil.assembleResult(code, null, StrFormatter.format("{}",exceptionCause)); + } } return HttpResultUtil.assembleResult(code, null, StrFormatter.format("{}{}{}", ReflectCommonUtil.getMethodDescribeByException(tempException), StrUtil.C_COMMA, exceptionCause)); }