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

Throw proper exception when request parsing fails #31

Open
JanHolger opened this issue Aug 30, 2024 · 0 comments
Open

Throw proper exception when request parsing fails #31

JanHolger opened this issue Aug 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@JanHolger
Copy link
Member

JanHolger commented Aug 30, 2024

Currently calling the .body method (or injecting it) and sending invalid content to the endpoint throws a generic java.text.ParseException or MapperWrongTypeException from abstract-data. The stacktrace is hard to debug since it doesn't contain any context (endpoint, invalid data, etc.)

Instead we should throw an exception that contains more context and can be properly handled in the exception handler and responded to.

  1. Invalid request body throws a specific exception
  2. The default exception handler, responds with 400
@JanHolger JanHolger added the enhancement New feature or request label Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant