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

imp: handle errors via standard mechanism - exceptions and error handlers #11080

Merged
merged 22 commits into from
Aug 13, 2024

Conversation

sdelamo
Copy link
Contributor

@sdelamo sdelamo commented Aug 13, 2024

Close: #11070

This PR superseeds #11070

@dstepanov

Including errors like incorrect HTTP method, content type etc. Right now it's only possible to catch this kind of error using a status route per status.
This is needed to align with JAX-RS where the exception handler can handle all the exceptions.

The main difference with #11070 is to move the status and message logic to individual exceptions and handlers. This PR adds:

  • NotFoundException
  • NotAllowedException
  • NotAcceptableException
  • NotWebSocketRequestException
  • UnsupportedMediaException

These exceptions are HttpStatusExceptions. These granularity gives users more flexibility. E.g. you may want to create your own NotFoundExceptionHandler to respond a HTML Page but you don't care about custom handlers for the other exceptions.

dstepanov and others added 16 commits August 12, 2024 12:17

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo
@sdelamo sdelamo changed the base branch from 4.6.x to allcatch August 13, 2024 07:50
@sdelamo sdelamo changed the title Allcatch status Create different exceptions for different errors Aug 13, 2024
@sdelamo sdelamo changed the base branch from allcatch to 4.6.x August 13, 2024 07:55
@sdelamo sdelamo marked this pull request as ready for review August 13, 2024 07:57
@sdelamo sdelamo requested a review from dstepanov August 13, 2024 07:58
@sdelamo sdelamo changed the title Create different exceptions for different errors imp: handle errors via standard mechanism - exceptions and error handlers Aug 13, 2024

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo
@sdelamo sdelamo added this to the 4.6.0 milestone Aug 13, 2024

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 New Bugs (required ≤ 0)
D Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Verified

This commit was signed with the committer’s verified signature.
sdelamo Sergio del Amo
@sdelamo sdelamo merged commit 2c1104b into 4.6.x Aug 13, 2024
1 of 4 checks passed
@sdelamo sdelamo deleted the allcatch-status branch August 13, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants