-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Predicate
- based mappedHandler config in AbstractHandlerExceptionResolver
#26772
Comments
If you create your own implementation of
One of the underlying principles of the functional endpoints is that they do not require reflection to operate. Supporting |
@poutsma There are some points I have to be cleared:
I agree with this. However, my situation is because of lacking of supporting in uniform handling global exception mechanism of functional controller usage in Spring MVC (as mention in option 1). Moreover, I do NOT suggest functional handler require reflection to operate. I suggest the old exception handler approach ( I think, because default
|
Predicate
- based mappedHandler config in AbstractHandlerExceptionResolver
Affects: Spring 5.3.5
I'm using Spring MVC framework with functional controller (HandlerFunction, HandlerFunctionFilter, are landed on Spring 5.2). While using it, I encountered problem with global exception capture.
If I use onError for handling exception, I still need to use
@ControllerAdvice
and@ErrorException
for non-path exceptions (AccessDeniedException
,NotFoundHandlerException
, ...). This is inconsistency. After some research, I decide to usemappedHandlerClasses
ofExceptionHandlerExceptionResolver
to handle exception in functional controller. However, when enable setting mappedHandlerClasses,ExceptionHandlerExceptionResolver
cannot handle non-path exceptions (AccessDeniedException
,NotFoundHandlerException
, ...).In my opinion,
ExceptionHandlerExceptionResolver
should capture bothHandlerMethod
(annotation controller) andHandlerFunction
(functional controller) in Spring MVC. Or another suggestion, it'smappedHandlerClasses
should not effect to capability of handlingHandlerMethod
ofExceptionHandlerExceptionResolver
.Or is there any clever way to resolve this issue? Currently, I work around by creating another
ExceptionHandlerExceptionResolver
withmappedHandlerClasses
for function controller exception handler, beside originalExceptionHandlerExceptionResolver
.The text was updated successfully, but these errors were encountered: