-
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
Make it easier for RESTEasy Reactive users to handle Hibernate related exceptions #20509
Conversation
…Easy Reactive Also add RollbackException to the list of unwrapped exceptions
|
||
@BuildStep | ||
public UnwrappedExceptionBuildItem unwrappedExceptions() { | ||
return new UnwrappedExceptionBuildItem(PersistenceException.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering if this should also include HibernateException
|
||
@BuildStep | ||
public UnwrappedExceptionBuildItem unwrappedExceptions() { | ||
return new UnwrappedExceptionBuildItem(PersistenceException.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering if this should also include HibernateException
Sorry I'm totally out of context :) Could you summarize what this is for? |
Of course! The idea is to make it very easy for a user to "handle" (in the JAX-RS sense) the actual root cause of an exception. Take for example the Hibernate ORM quickstart, where trying to save a new Fruit with an existing name leads to a ConstraintViolationException. If a user currently wants to respond to HTTP 400 for that exception, they need handle the RollbackException, then look of the cause is a PersistenceException and check if that one's cause is a ConstraintViolationException. Does that make sense? |
@Sanne is this good for you as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, thanks
👍🏼 |
No description provided.