Skip to content

Commit

Permalink
More informative error messaging when something goes wrong talking to
Browse files Browse the repository at this point in the history
the server (also, rethrowing error so we actually stop on error)
  • Loading branch information
schuemie committed Jan 30, 2018
1 parent 4a47464 commit ea4acb4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/org/ohdsi/databases/ConnectionWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ public void setBatchMode(boolean batchMode) {
statement = connection.createStatement();
}
} catch (SQLException e) {
System.err.println("Error: " + e.getMessage());
e.printStackTrace();
e = e.getNextException();
if (e != null) {
System.err.println("Error: " + e.getMessage());
e.printStackTrace();
}
throw new RuntimeException("Error executing batch data");
}
}

Expand Down

0 comments on commit ea4acb4

Please sign in to comment.