Skip to content
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

If an exception occurs during Pre-Flight request processing, @ExceptionHandler fails to handle it. #27338

Closed
ddaaac opened this issue Aug 30, 2021 · 3 comments
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket)

Comments

@ddaaac
Copy link

ddaaac commented Aug 30, 2021

Affects: 5.2.12


Hi, I have used interceptor to verify something. And an exception occurred in the interceptor while processing the Pre-Flight request. However, since PreFlightHandler is not a child of HandlerMethod, the exception that occurs during the Pre-Flight process is not handled by the ExceptionHandler.(Since AbstractHandlerMethodExceptionResolver only apply to HandlerMethod). So, response status becomes 500 not status I intended.
Is this intended or just a bug?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 30, 2021
@rstoyanchev
Copy link
Contributor

@ddaaac the pre-flight handler should update the response and typically there should be no need for any exception handling. Is DefaultCorsProcessor running into an exception somehow? Or are you handling this through the CorsFilter in which case the request doesn't even reach the DispatcherSevlet?

Note that starting in 5.3 we do support use of @ControllerAdvice to handle exceptions from any handler, but again for pre-flight requests, there shouldn't be any exceptions.

@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) status: waiting-for-feedback We need additional information before we can continue labels Sep 24, 2021
rstoyanchev added a commit that referenced this issue Sep 24, 2021
In 5.3 it became possible to handle exceptions from any handler through
ExceptionHandler's in a ControllerAdvice class, but this is not
mentioned in the docs

See gh-22619, gh-27338
@spring-projects-issues
Copy link
Collaborator

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Oct 1, 2021
@spring-projects-issues
Copy link
Collaborator

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket)
Projects
None yet
Development

No branches or pull requests

3 participants