This commit is contained in:
2023-09-04 11:26:55 +08:00
parent 3177b40b4f
commit 54b3ad9a7c

View File

@@ -232,8 +232,10 @@ public class GlobalBusinessExceptionHandler {
logService.recodeBusinessExceptionLog(tempException, httpServletRequest, exceptionCause); logService.recodeBusinessExceptionLog(tempException, httpServletRequest, exceptionCause);
//判断方法上是否有自定义注解,做特殊处理 //判断方法上是否有自定义注解,做特殊处理
Method method = ReflectCommonUtil.getMethod(exception); Method method = ReflectCommonUtil.getMethod(exception);
if(method.isAnnotationPresent(ReturnMsg.class)){ if (!Objects.isNull(method)){
return HttpResultUtil.assembleResult(code, null, StrFormatter.format("{}",exceptionCause)); 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)); return HttpResultUtil.assembleResult(code, null, StrFormatter.format("{}{}{}", ReflectCommonUtil.getMethodDescribeByException(tempException), StrUtil.C_COMMA, exceptionCause));
} }