This is an automated email from the ASF dual-hosted git repository. rmaucher pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 21d8a2b6d976efd2d1a5e8e9b5ea8812f596bbc3 Author: opencode <[email protected]> AuthorDate: Tue Sep 29 19:43:54 2026 +0200 Log the error message returned by a JMX task when failOnError is false instead of discarding it --- java/org/apache/catalina/ant/jmx/JMXAccessorTask.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java b/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java index d6b71df30d..d9a63f2220 100644 --- a/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java +++ b/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java @@ -403,10 +403,14 @@ public class JMXAccessorTask extends BaseRedirectorHelperTask { MBeanServerConnection jmxServerConnection = getJMXConnection(); error = jmxExecute(jmxServerConnection); - if (error != null && isFailOnError()) { - // exception should be thrown only if failOnError == true - // or error line will be logged twice - throw new BuildException(error); + if (error != null) { + if (isFailOnError()) { + // exception should be thrown only if failOnError == true + // or error line will be logged twice + throw new BuildException(error); + } + // Ant semantics for failOnError="false" are to report the error and continue + handleErrorOutput(error); } } catch (Exception e) { if (isFailOnError()) { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
