From c7a282f9415544a2ea5c946ecdb28fe465f7b6b7 Mon Sep 17 00:00:00 2001 From: Andrew Quan Date: Wed, 15 Nov 2023 14:36:57 -0500 Subject: [PATCH] Throw BuildExceptions in ReplaceRegExp for errors --- .../apache/tools/ant/taskdefs/optional/ReplaceRegExp.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java b/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java index c5b9d7d43a..524568cd38 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java @@ -481,10 +481,13 @@ public void execute() throws BuildException { log("An error occurred processing file: '" + file.getAbsolutePath() + "': " + e.toString(), Project.MSG_ERR); + throw new BuildException("An error occurred processing file: '" + file.getAbsolutePath() + "'", + e, getLocation()); } } else if (file != null) { log("The following file is missing: '" + file.getAbsolutePath() + "'", Project.MSG_ERR); + throw new BuildException("The following file is missing: '" + file.getAbsolutePath() + "'"); } if (resources != null) { @@ -498,10 +501,13 @@ public void execute() throws BuildException { log("An error occurred processing file: '" + f.getAbsolutePath() + "': " + e.toString(), Project.MSG_ERR); + throw new BuildException("An error occurred processing file: '" + f.getAbsolutePath() + "'", + e, getLocation()); } } else { log("The following file is missing: '" + f.getAbsolutePath() + "'", Project.MSG_ERR); + throw new BuildException("The following file is missing: '" + f.getAbsolutePath() + "'"); } } }