-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Built-in RestDataPanacheExceptionMapper is not overridable or has higher priority #38799
Comments
/cc @FroMage (panache), @loicmathieu (panache) |
Can you please attach a sample application that behaves as you mention, as I tried to reproduce this and it worked as expected. Thanks |
Hi @geoand , Thanks for the quick response.
While playing with it more I came across an interesting case. However, moving the |
I am not sure what the problem is, but if you use |
Thanks @geoand |
Describe the bug
The PanacheEntityResource implementations throws RestDataPanacheException which is handled by the built-in io.quarkus.hibernate.orm.rest.data.panache.runtime.RestDataPanacheExceptionMapper class. I want to return custom responses for certain types of RestDataPanacheExceptions but my custom ExceptionMapper is used neither in dev mode nor when I run uber jar.
This issue is similar to #7883 but not sure if the fix was specific to all exception mappers or only for NotFoundExceptionMapper.
Expected behavior
The custom ExceptionMapper implemented by the user must take precedence.
Actual behavior
The custom ExceptionMapper is not used at all. Always Quarkust runs the default RestDataPanacheExceptionMapper.
How to Reproduce?
PanacheEntityResource
for an entity with generated idExceptionMapper<RestDataPanacheException>
Output of
uname -a
orver
Linux mypc 5.15.0-94-generic #104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
java version "21.0.1" 2023-10-17 LTS Java(TM) SE Runtime Environment (build 21.0.1+12-LTS-29) Java HotSpot(TM) 64-Bit Server VM (build 21.0.1+12-LTS-29, mixed mode, sharing)
Quarkus version or git rev
3.7.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.6
Additional information
No response
The text was updated successfully, but these errors were encountered: