Browse Source

It may be better to set the property before an exception is thrown

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@807230 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
8d275b78c2
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      src/main/org/apache/tools/ant/taskdefs/SQLExec.java

+ 6
- 6
src/main/org/apache/tools/ant/taskdefs/SQLExec.java View File

@@ -645,16 +645,16 @@ public class SQLExec extends JDBCTask {
}
} catch (IOException e) {
closeQuietly();
setErrorProperty();
if (onError.equals("abort")) {
throw new BuildException(e, getLocation());
}
setErrorProperty();
} catch (SQLException e) {
closeQuietly();
setErrorProperty();
if (onError.equals("abort")) {
throw new BuildException(e, getLocation());
}
setErrorProperty();
} finally {
try {
if (getStatement() != null) {
@@ -788,13 +788,13 @@ public class SQLExec extends JDBCTask {
goodSql++;
} catch (SQLException e) {
log("Failed to execute: " + sql, Project.MSG_ERR);
setErrorProperty();
if (!onError.equals("abort")) {
log(e.toString(), Project.MSG_ERR);
}
if (!onError.equals("continue")) {
throw e;
}
setErrorProperty();
} finally {
if (resultSet != null) {
try {
@@ -1093,12 +1093,12 @@ public class SQLExec extends JDBCTask {
warning = warning.getNextWarning();
}
}
if (treatWarningsAsErrors && initialWarning != null) {
throw initialWarning;
}
if (initialWarning != null) {
setWarningProperty();
}
if (treatWarningsAsErrors && initialWarning != null) {
throw initialWarning;
}
}

protected final void setErrorProperty() {


Loading…
Cancel
Save