geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r662171 - /geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultCommandExecutor.java
Date Sun, 01 Jun 2008 08:35:27 GMT
Author: jdillon
Date: Sun Jun  1 01:35:27 2008
New Revision: 662171

URL: http://svn.apache.org/viewvc?rev=662171&view=rev
Log:
Don't hind exception details

Modified:
    geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultCommandExecutor.java

Modified: geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultCommandExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultCommandExecutor.java?rev=662171&r1=662170&r2=662171&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultCommandExecutor.java
(original)
+++ geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultCommandExecutor.java
Sun Jun  1 01:35:27 2008
@@ -26,6 +26,7 @@
 import org.apache.geronimo.gshell.command.Variables;
 import org.apache.geronimo.gshell.common.Arguments;
 import org.apache.geronimo.gshell.common.StopWatch;
+import org.apache.geronimo.gshell.common.Notification;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.layout.LayoutManager;
 import org.apache.geronimo.gshell.layout.NotFoundException;
@@ -204,19 +205,13 @@
         if (!errors.isEmpty()) {
             Throwable t = errors.get(0);
 
-            //
-            // FIXME: Should not throw here, as that will cause the originating stack trace
to be lost
-            //
-
-            if (t instanceof Exception) {
-                throw (Exception) t;
-            }
-            else if (t instanceof Error) {
-                throw (Error) t;
-            }
-            else {
-                throw new RuntimeException(t);
+            // Always preserve the type of notication throwables, reguardless of the trace
+            if (t instanceof Notification) {
+                throw (Notification)t;
             }
+
+            // Otherwise wrap to preserve the trace
+            throw new CommandExecutionFailied(t);
         }
 
         return ref.get();



Mime
View raw message