-
Notifications
You must be signed in to change notification settings - Fork 355
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
Default exception mapper processing #5193
Merged
jansupol
merged 1 commit into
eclipse-ee4j:3.1
from
zUniQueX:default-exception-mapper-processing
Nov 14, 2022
Merged
Default exception mapper processing #5193
jansupol
merged 1 commit into
eclipse-ee4j:3.1
from
zUniQueX:default-exception-mapper-processing
Nov 14, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…erFactory to avoid skipping an other exception mapper for Throwable
zUniQueX
force-pushed
the
default-exception-mapper-processing
branch
from
November 12, 2022 16:45
261d3d9
to
8c97e2e
Compare
jansupol
approved these changes
Nov 14, 2022
This was referenced Jan 31, 2023
This was referenced Feb 11, 2023
This was referenced Mar 11, 2023
1 task
This was referenced Mar 23, 2023
1 task
This was referenced Jul 24, 2023
This was referenced Aug 14, 2023
1 task
This was referenced Sep 11, 2023
1 task
This was referenced Nov 25, 2023
1 task
This was referenced Jan 3, 2024
1 task
1 task
1 task
1 task
Open
1 task
1 task
1 task
This was referenced Jul 9, 2024
1 task
1 task
1 task
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #5192
Problem
The default exception mapper is registered by default in Jersey 3.1.0 and is made avilable through
ExceptionMapperFactory
. If an other exception mapper is registered asExceptionMapper<Throwable>
, the first one found will be used. This can lead to a reordering issue where the default exception mapper will be found first.The
ServerRuntime
additionally won't handle exceptions, if the default exception mapper is returned byExceptionMapperFactory.findMapping(...)
(see here) and instead will handle the exception with the default exception mapper in a separate method.Solution
The proposed change in this PR is to avoid registration of the default exception mapper in the
ExceptionMapperFactory
. This will leave the exception mapper resolving logic as it was in Jersey 3.0.x and provide users the ability to register anExceptionMapper<Throwable>
. If none is set, theServerRuntime
will eventually handle the exception afterwards because no exception mapper is found.