From 76a6e36fe5ebb6170b20591616ee634f7b51f342 Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Tue, 17 Feb 2004 15:41:04 +0000 Subject: [PATCH] subant: catch throwables from ant.execute() with failonerror is false PR: 27007 Reported by: Mariano Benitez git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276102 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/SubAnt.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/org/apache/tools/ant/taskdefs/SubAnt.java b/src/main/org/apache/tools/ant/taskdefs/SubAnt.java index 96c169329..52af688dd 100644 --- a/src/main/org/apache/tools/ant/taskdefs/SubAnt.java +++ b/src/main/org/apache/tools/ant/taskdefs/SubAnt.java @@ -187,6 +187,14 @@ public class SubAnt log("Failure for target '" + target + "' of: " + antfilename + "\n" + e.getMessage(), Project.MSG_WARN); + } catch (Throwable e) { + if (failOnError) { + throw new BuildException(e); + } + log("Failure for target '" + target + + "' of: " + antfilename + "\n" + + e.toString(), + Project.MSG_WARN); } }