From e7418c42017ce223f33b4c97dfbcb7a72affe205 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 29 Nov 2005 04:35:59 +0000 Subject: [PATCH] take failOnError into account git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@349629 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/LoadResource.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/LoadResource.java b/src/main/org/apache/tools/ant/taskdefs/LoadResource.java index 1ddcd1fc7..37794c8b1 100755 --- a/src/main/org/apache/tools/ant/taskdefs/LoadResource.java +++ b/src/main/org/apache/tools/ant/taskdefs/LoadResource.java @@ -116,7 +116,13 @@ public class LoadResource extends Task { throw new BuildException("output property not defined"); } if (!src.isExists()) { - throw new BuildException(src + " doesn't exist"); + String message = src + " doesn't exist"; + if (failOnError) { + throw new BuildException(message); + } else { + log(message, Project.MSG_ERR); + return; + } } InputStream is = null; BufferedInputStream bis = null;