-
Notifications
You must be signed in to change notification settings - Fork 49
Pull request to fix the issue: #655 #908
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
base: master
Are you sure you want to change the base?
Conversation
…arity. - Unwrap `UndeclaredThrowableException` for proxy-related exceptions. - Unwrap `InvocationTargetException` for reflection-related exceptions. - Add null-safe handling for exception messages. - Improve readability of PostgreSQL-specific checks. - Improve readability of SQL Server-specific checks. - Ensure compatibility with standard JDBC constraint violations.
Hey @andreconrado . This looks great. Could you add a cross-dialect test for this? Adding it to |
Is this actually to fix #655 ? |
Yes, sorry, I had it wrong in the title and description, I copied the wrong link 😁 |
Hi @badgerwithagun, I only added some validations before checking the source of the Exception, so the existing tests should confirm that my changes work - or at least don’t affect what was already there. In this case, do I need to change the tests? |
It's pretty straightforward; I'm happy to help. Obviously for the existing scenarios we have this test. You've added support for wrapped exceptions, so all we need to do is create a version of that test which causes the exception to be wrapped. First thing I would try is something like this. In this new test, copy the existing one but change:
To
This should result in any exceptions in the |
Hi @badgerwithagun, thanks for the tips! I think I’ll still need your help. The line
The |
Hi again @badgerwithagun, To be able to run the test, we need to change the dependency from: <dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency> to: <dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.19.0</version>
<scope>test</scope>
</dependency> Are you interested in making this change? Is it worth it just for this test? Thanks. |
Pull request to fix the issue: #655
Refactor
indexViolation
to handle wrapped exceptions and improve clarity.UndeclaredThrowableException
for proxy-related exceptions.InvocationTargetException
for reflection-related exceptions.