Skip to content

Commit

Permalink
if continue on error, continue on ANY error
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Jul 13, 2014
1 parent aacc7f4 commit 070fee0
Showing 1 changed file with 11 additions and 6 deletions.
Expand Up @@ -369,15 +369,20 @@ private void insertRandomRecord(Table table) {
if (verbose) {
System.out.println("Successful insert into " + tbl.getName());
}
} catch (SqlException ex) {
log.error("Failed to process {} with values of {}", statement.getSql(),
ArrayUtils.toString(statementValues));
} catch (Exception ex) {
log.error("Failed to process {} with values of {} because: {}", new Object[] {statement.getSql(),
ArrayUtils.toString(statementValues), ex.getMessage() });
if (continueOnError) {
if (debug) {
ex.printStackTrace();
if (debug || !(ex instanceof SqlException)) {
log.debug(ex.getMessage(), ex);
}
} else {
throw ex;
if (ex instanceof RuntimeException) {
throw (RuntimeException)ex;
} else {
throw new RuntimeException(ex);
}

}
}
}
Expand Down

0 comments on commit 070fee0

Please sign in to comment.