servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r638923 - /servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java
Date Wed, 19 Mar 2008 16:28:16 GMT
Author: gnodet
Date: Wed Mar 19 09:28:11 2008
New Revision: 638923

URL: http://svn.apache.org/viewvc?rev=638923&view=rev
Log:
SMX4KNL-6: Error Message improvement on Gshell console when a command is not found

Modified:
    servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java?rev=638923&r1=638922&r2=638923&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java
Wed Mar 19 09:28:11 2008
@@ -26,6 +26,7 @@
 import org.apache.geronimo.gshell.command.IO;
 import org.apache.geronimo.gshell.common.Arguments;
 import org.apache.geronimo.gshell.console.Console;
+import org.apache.geronimo.gshell.layout.NotFoundException;
 import org.apache.geronimo.gshell.shell.Environment;
 import org.apache.geronimo.gshell.shell.InteractiveShell;
 import org.apache.servicemix.kernel.main.spi.MainService;
@@ -35,7 +36,6 @@
 import org.osgi.framework.FrameworkListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.DisposableBean;
 import org.springframework.osgi.context.BundleContextAware;
 
 /**
@@ -187,8 +187,13 @@
             public Result handleError(Throwable error) {
                 if (closed) {
                     throw new ExitNotification();
+                } else if (error instanceof NotFoundException) {
+                    // Spit out the terse reason why we've failed
+                    io.err.println("@|bold,red ERROR| Command not found: @|bold,red " + error.getMessage()
+ "|");
+                    return Result.CONTINUE;
+                } else {
+                    return handler.handleError(error);
                 }
-                return handler.handleError(error);
             }
         };
     }



Mime
View raw message