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

Print stack trace of wrapped SQLException #22

Merged
merged 1 commit into from Feb 11, 2014

Conversation

tendant
Copy link
Contributor

@tendant tendant commented Nov 1, 2013

In PostgreSQL, in case there is SQLException during migration, the stack trace printed out is a generic statement like:

Exception in thread "main" java.sql.BatchUpdateException: Batch entry 0 alter table foo rename column bar to bar2 was aborted. Call getNextException to see the cause.

This patch will get next exception and print out stack trace for the root cause of this failure. The result will look like below:

org.postgresql.util.PSQLException: ERROR: relation "foo" does not exist
...
Exception in thread "main" java.sql.BatchUpdateException: Batch entry 0 alter table foo rename column bar to bar2 was aborted. Call getNextException to see the cause.eError(QueryExecutorImpl.java:457)

@ddellacosta
Copy link

Just independently implemented the same exact thing. +1, would be quite useful to have this incorporated.

@bowmanb
Copy link

bowmanb commented Feb 11, 2014

Agreed, would be useful.

weavejester added a commit that referenced this pull request Feb 11, 2014
Print stack trace of wrapped SQLException
@weavejester weavejester merged commit f489957 into weavejester:master Feb 11, 2014
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

Successfully merging this pull request may close these issues.

None yet

4 participants