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

HandlerMethodValidationException is not handled properly #3

Open
ericafenyo opened this issue Jun 22, 2024 · 1 comment
Open

HandlerMethodValidationException is not handled properly #3

ericafenyo opened this issue Jun 22, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ericafenyo
Copy link
Owner

The exception thrown is HandlerMethodValidationException when @NotBlank is declared directly on method parameters such as @PathVariable. However, we were expecting MethodArgumentNotValidException, which is currently handled, to return a custom error response.

@ericafenyo ericafenyo self-assigned this Jun 22, 2024
@ericafenyo ericafenyo converted this from a draft issue Jun 22, 2024
@ericafenyo ericafenyo added the bug Something isn't working label Jun 22, 2024
@ericafenyo
Copy link
Owner Author

ericafenyo commented Jun 24, 2024

The spring docs explained they type of exception thrown during validation and proposed a way to handle each case.

https://docs.spring.io/spring-framework/reference/web/webmvc/mvc-controller/ann-validation.html

@ericafenyo ericafenyo moved this from Backlog to Ready in senior hub kanban Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Ready
Development

No branches or pull requests

1 participant