Browse Source

At least try to log the real reason of an error. PR 26086

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@708584 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
99529fd6c5
2 changed files with 19 additions and 1 deletions
  1. +4
    -0
      WHATSNEW
  2. +15
    -1
      src/main/org/apache/tools/ant/Main.java

+ 4
- 0
WHATSNEW View File

@@ -278,6 +278,10 @@ Fixed bugs:
some setups.
Bugzilla Report 46063.

* if an error occurs while logging the buildFinished event, the
original error is now logged to System.err.
Bugzilla Report 25086.

Other changes:
--------------



+ 15
- 1
src/main/org/apache/tools/ant/Main.java View File

@@ -792,7 +792,21 @@ public class Main implements AntMain {
throw e;
} finally {
if (!projectHelp) {
project.fireBuildFinished(error);
try {
project.fireBuildFinished(error);
} catch (Throwable t) {
// yes, I know it is bad style to catch Throwable,
// but if we don't, we lose valuable information
System.err.println("Caught an exception while logging the"
+ " end of the build. Exception was:");
t.printStackTrace();
if (error != null) {
System.err.println("There has been an error prior to"
+ " that:");
error.printStackTrace();
}
throw new BuildException(t);
}
} else if (error != null) {
project.log(error.toString(), Project.MSG_ERR);
}


Loading…
Cancel
Save