This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-exec.git

commit 01811997f4134283e3066d35f526c264f581ad0a
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Fri Dec 29 11:07:46 2023 -0500

    Propagate exception in DebugUtils.handleException(String, Exception)
---
 src/changes/changes.xml                                    | 1 +
 src/main/java/org/apache/commons/exec/util/DebugUtils.java | 5 +----
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index a63dce2f..3be929ab 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -41,6 +41,7 @@
             <action dev="ggregory" type="fix" due-to="Gary Gregory">Port from 
JUnit 4 to 5.</action>
             <action dev="ggregory" type="fix" due-to="ArdenL-Liu, Gary 
Gregory">[Javadoc] CommandLine.toCleanExecutable(final String dirtyExecutable) 
IllegalArgumentException #61.</action>
             <action dev="ggregory" type="fix" due-to="Gary 
Gregory">ExecuteException propagates its cause to its IOException 
superclass.</action>
+            <action dev="ggregory" type="fix" due-to="Gary Gregory">Propagate 
exception in DebugUtils.handleException(String, Exception).</action>
             <!-- REMOVE -->
             <action dev="ggregory" type="remove" due-to="Gary 
Gregory">Deprecate DefaultExecuteResultHandler.waitFor(long).</action>
             <action dev="ggregory" type="remove" due-to="Gary 
Gregory">Deprecate ExecuteWatchdog.ExecuteWatchdog(long).</action>
diff --git a/src/main/java/org/apache/commons/exec/util/DebugUtils.java 
b/src/main/java/org/apache/commons/exec/util/DebugUtils.java
index 2ff2b9b5..cb8fbee8 100644
--- a/src/main/java/org/apache/commons/exec/util/DebugUtils.java
+++ b/src/main/java/org/apache/commons/exec/util/DebugUtils.java
@@ -39,18 +39,15 @@ public class DebugUtils {
      * @param e   an exception being handled
      */
     public static void handleException(final String msg, final Exception e) {
-
         if (isDebugEnabled()) {
             System.err.println(msg);
             e.printStackTrace();
         }
-
         if (!isLenientEnabled()) {
             if (e instanceof RuntimeException) {
                 throw (RuntimeException) e;
             }
-            // can't pass root cause since the constructor is not available on 
JDK 1.3
-            throw new RuntimeException(e.getMessage());
+            throw new RuntimeException(e);
         }
     }
 

Reply via email to