if (tex instanceof SyntaxError) {
if (tex instanceof SyntaxErrorException) {
    public void invoke(String cmdLineStr) {        final CommandLine cmdLine = new CommandLine(cmdLineStr);        if (!cmdLine.hasNext()) return;        String cmdName = cmdLine.next();        commandShell.addCommandToHistory(cmdLineStr);        //        System.err.println("Got command: "+cmdLineStr+", name="+cmdName);        try {            Class cmdClass = commandShell.getCommandClass(cmdName);            //            System.err.println("CmdClass="+cmdClass);            final Method main = cmdClass.getMethod("main", MAIN_ARG_TYPES);            //            System.err.println("main="+main);            try {                //                System.err.println("Invoking...");                try {                    final Object[] args = new Object[] { cmdLine.getRemainder()                            .toStringArray()};                    AccessController.doPrivileged(new InvokeAction(main, null, args));                } catch (PrivilegedActionException ex) {                    throw ex.getException();                }                                //main.invoke(null, );                //                System.err.println("Finished invoke.");            } catch (InvocationTargetException ex) {                Throwable tex = ex.getTargetException();                if (tex instanceof SyntaxError) {                    Help.getInfo(cmdClass).usage();                    err.println(tex.getMessage());                } else {                    err.println("Exception in command");                    tex.printStackTrace(err);                }            } catch (Exception ex) {                err.println("Exception in command");                ex.printStackTrace(err);            } catch (Error ex) {                err.println("Fatal error in command");                ex.printStackTrace(err);            }        } catch (NoSuchMethodException ex) {            err.println("Alias class has no main method " + cmdName);        } catch (ClassNotFoundException ex) {            err.println("Unknown alias class " + ex.getMessage());        } catch (ClassCastException ex) {            err.println("Invalid command " + cmdName);        } catch (Exception ex) {            err.println("I FOUND AN ERROR: " + ex);        }    }