【更新】优化异常处理

pull/110/MERGE
xuyuxiang 2023-05-23 11:01:38 +08:00
parent aea99f1a76
commit 8459e94215
3 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ public class AuthExceptionUtil {
// 未知异常才打印
log.error(">>> 服务器未知异常,请求地址:{},具体信息:", CommonServletUtil.getRequest().getRequestURL(), e);
// 未知异常返回服务器异常此处不可能执行进入因为本方法处理的一定是SaToken的异常此处仅为安全性考虑
commonResult = CommonResult.error("服务器异常");
commonResult = CommonResult.error();
}
return commonResult;
}

View File

@ -69,7 +69,7 @@ public class GlobalErrorAttributesHandler extends DefaultErrorAttributes {
}
} else {
// throwable为空则直接返回默认异常
return BeanUtil.beanToMap(CommonResult.error("服务器异常,请求地址:" + CommonServletUtil.getRequest().getRequestURL()));
return BeanUtil.beanToMap(CommonResult.error());
}
}
}

View File

@ -140,7 +140,7 @@ public class GlobalExceptionUtil {
// 未知异常打印详情
log.error(">>> 服务器未知异常,请求地址:{},具体信息:", CommonServletUtil.getRequest().getRequestURL(), e);
// 未知异常返回服务器异常
commonResult = CommonResult.error("服务器异常");
commonResult = CommonResult.error();
}
return commonResult;
}