初始化 system 服务
This commit is contained in:
@@ -83,9 +83,9 @@ public class GlobalExceptionHandler {
|
||||
if (ex instanceof HttpRequestMethodNotSupportedException) {
|
||||
return httpRequestMethodNotSupportedExceptionHandler((HttpRequestMethodNotSupportedException) ex);
|
||||
}
|
||||
if (ex instanceof RequestNotPermitted) {
|
||||
return requestNotPermittedExceptionHandler(request, (RequestNotPermitted) ex);
|
||||
}
|
||||
// if (ex instanceof RequestNotPermitted) {
|
||||
// return requestNotPermittedExceptionHandler(request, (RequestNotPermitted) ex);
|
||||
// }
|
||||
if (ex instanceof ServiceException) {
|
||||
return serviceExceptionHandler((ServiceException) ex);
|
||||
}
|
||||
@@ -183,14 +183,15 @@ public class GlobalExceptionHandler {
|
||||
return CommonResult.error(METHOD_NOT_ALLOWED.getCode(), String.format("请求方法不正确:%s", ex.getMessage()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理 Resilience4j 限流抛出的异常
|
||||
*/
|
||||
@ExceptionHandler(value = RequestNotPermitted.class)
|
||||
public CommonResult<?> requestNotPermittedExceptionHandler(HttpServletRequest req, RequestNotPermitted ex) {
|
||||
log.warn("[requestNotPermittedExceptionHandler][url({}) 访问过于频繁]", req.getRequestURL(), ex);
|
||||
return CommonResult.error(TOO_MANY_REQUESTS);
|
||||
}
|
||||
// TODO 芋艿:暂时去掉
|
||||
// /**
|
||||
// * 处理 Resilience4j 限流抛出的异常
|
||||
// */
|
||||
// @ExceptionHandler(value = RequestNotPermitted.class)
|
||||
// public CommonResult<?> requestNotPermittedExceptionHandler(HttpServletRequest req, RequestNotPermitted ex) {
|
||||
// log.warn("[requestNotPermittedExceptionHandler][url({}) 访问过于频繁]", req.getRequestURL(), ex);
|
||||
// return CommonResult.error(TOO_MANY_REQUESTS);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 处理 Spring Security 权限不足的异常
|
||||
|
||||
Reference in New Issue
Block a user