mirror of https://gitee.com/xiaonuobase/snowy
【更新】优化异常处理
parent
aea99f1a76
commit
8459e94215
|
@ -60,7 +60,7 @@ public class AuthExceptionUtil {
|
|||
// 未知异常才打印
|
||||
log.error(">>> 服务器未知异常,请求地址:{},具体信息:", CommonServletUtil.getRequest().getRequestURL(), e);
|
||||
// 未知异常返回服务器异常(此处不可能执行进入,因为本方法处理的一定是SaToken的异常,此处仅为安全性考虑)
|
||||
commonResult = CommonResult.error("服务器异常");
|
||||
commonResult = CommonResult.error();
|
||||
}
|
||||
return commonResult;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class GlobalErrorAttributesHandler extends DefaultErrorAttributes {
|
|||
}
|
||||
} else {
|
||||
// throwable为空,则直接返回默认异常
|
||||
return BeanUtil.beanToMap(CommonResult.error("服务器异常,请求地址:" + CommonServletUtil.getRequest().getRequestURL()));
|
||||
return BeanUtil.beanToMap(CommonResult.error());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ public class GlobalExceptionUtil {
|
|||
// 未知异常打印详情
|
||||
log.error(">>> 服务器未知异常,请求地址:{},具体信息:", CommonServletUtil.getRequest().getRequestURL(), e);
|
||||
// 未知异常返回服务器异常
|
||||
commonResult = CommonResult.error("服务器异常");
|
||||
commonResult = CommonResult.error();
|
||||
}
|
||||
return commonResult;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue