-
Notifications
You must be signed in to change notification settings - Fork 41.3k
Closed as not planned
Closed as not planned
Copy link
Labels
for: external-projectFor an external project and not something we can fixFor an external project and not something we can fixstatus: duplicateA duplicate of another issueA duplicate of another issue
Description
Problem :
After updating to SpringBoot 3.2.0 everytime 404 NoResourceFoundException
happened, it will re-route to 500 error due to default exception handler in @ControllerAdvice
.
@ExceptionHandler
@ResponseStatus(INTERNAL_SERVER_ERROR)
fun handleAllOtherExceptions(ex: Exception) {
log.error(ex) { "exception occurred" }
}
How to reproduce :
- Clone example project on my Github
- Go to deployment/local and run sh start.sh (it will start docker container locally)
- Run SpringBoot application
- Test using Postman with invalid url :
localhost:8100/invalidURI/1
- To simulate success case, remove exception handler code bellow in class
RestExceptionHandler:
@ExceptionHandler
@ResponseStatus(INTERNAL_SERVER_ERROR)
fun handleAllOtherExceptions(ex: Exception) {
log.error(ex) { "exception occurred" }
}
Expected behaviour
- 404
NoResourceFoundException
should not route to 500 error.
zhaoxi2000
Metadata
Metadata
Assignees
Labels
for: external-projectFor an external project and not something we can fixFor an external project and not something we can fixstatus: duplicateA duplicate of another issueA duplicate of another issue