HttpServletResponse response, @Nullable HandlerMethod handlerMethod, Exception exception) { ServletInvocableHandlerMethod exceptionHandlerMethod = getExceptionHandlerMethod(handlerMethod, exception); if (exceptionHandlerMethod == null) { return null;
HttpServletResponse response, @Nullable HandlerMethod handlerMethod, Exception exception) { ServletInvocableHandlerMethod exceptionHandlerMethod = getExceptionHandlerMethod(handlerMethod, exception); if (exceptionHandlerMethod == null) { return null;
@Override protected ServletInvocableHandlerMethod getExceptionHandlerMethod(final HandlerMethod handlerMethod, final Exception exception) { if (((InvocationException) exception).getStatusCode() == HttpStatus.BAD_REQUEST.value()) { Method method = new ExceptionHandlerMethodResolver(BadRequestExceptionAdvice.class).resolveMethod(exception); return new ServletInvocableHandlerMethod(new BadRequestExceptionAdvice(), method); } else if (((InvocationException) exception).getStatusCode() == HttpStatus.TOO_MANY_REQUESTS.value()) { Method method = new ExceptionHandlerMethodResolver(TooManyRequestsExceptionAdvice.class).resolveMethod(exception); return new ServletInvocableHandlerMethod(new TooManyRequestsExceptionAdvice(), method); } return super.getExceptionHandlerMethod(handlerMethod, exception); } }
HttpServletResponse response, HandlerMethod handlerMethod, Exception exception) { ServletInvocableHandlerMethod exceptionHandlerMethod = getExceptionHandlerMethod(handlerMethod, exception); if (exceptionHandlerMethod == null) { return null;