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

Documentation/Implementation issue for the default exception mapper in Jersey 3.1.0 #5192

Closed
zUniQueX opened this issue Nov 11, 2022 · 0 comments
Milestone

Comments

@zUniQueX
Copy link
Contributor

Hi Jersey team,

the current documentation for the default exception mapper doesn't correctly explain the behaviour of Jersey 3.1.0.

Processing of the default Exception Mapper occurs at the very end of the exception processing chain. It is invoked only if nothing else in the chain was invoked before.

The JAX-RS spec isn't that restrictive on the processing of the default exception mapper, it only states that a mapper for a Throwable has to be provided.

While upgrading an existing application to Jersey 3.1.0 I experienced that an other exception mapper for the Throwable type won't get invoked, but rather the default exception mapper.

This behaviour should be caused here. The collection for the exception mappers is a Set, so the default exception mapper may be processed earlier than an other one for Throwable.

From the perspective of the spec, the current implementation is fine and only the documentation is misleading. But the behaviour of the current Jersey documentation is the one to prefer IMHO. So I'd suggest to use a list and add the default exception mapper as the last element.

@senivam senivam added this to the 3.1.1 milestone Nov 14, 2022
@senivam senivam closed this as completed Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants