public static ScriptException unwrap(groovy.util.ScriptException cause) { // Special handling for groovy.util.ScriptException // which may be thrown by scripts because it is imported by default // by groovy imports String msg = cause.getMessage(); ScriptException translated; if (msg != null) { translated = new ScriptException(msg); } else { translated = new ScriptException(); } translated.setStackTrace(cause.getStackTrace()); return translated; }
@Command public String main() { throw new org.crsh.command.ScriptException(); } }
break; } else { throw new ScriptException("Language " + name + " does not provide a repl"); throw new ScriptException("Language " + name + " not active"); context.provide("Using repl " + name); } else { throw new ScriptException("Repl " + name + " not found");
static ScriptException toScript(Throwable cause) { if (cause instanceof ScriptException) { return (ScriptException)cause; } if (cause instanceof groovy.util.ScriptException) { // Special handling for groovy.util.ScriptException // which may be thrown by scripts because it is imported by default // by groovy imports String msg = cause.getMessage(); ScriptException translated; if (msg != null) { translated = new ScriptException(msg); } else { translated = new ScriptException(); } translated.setStackTrace(cause.getStackTrace()); return translated; } else { return new ScriptException(cause); } }
public static ScriptException unwrap(groovy.util.ScriptException cause) { // Special handling for groovy.util.ScriptException // which may be thrown by scripts because it is imported by default // by groovy imports String msg = cause.getMessage(); ScriptException translated; if (msg != null) { translated = new ScriptException(msg); } else { translated = new ScriptException(); } translated.setStackTrace(cause.getStackTrace()); return translated; }
public static ScriptException unwrap(groovy.util.ScriptException cause) { // Special handling for groovy.util.ScriptException // which may be thrown by scripts because it is imported by default // by groovy imports String msg = cause.getMessage(); ScriptException translated; if (msg != null) { translated = new ScriptException(msg); } else { translated = new ScriptException(); } translated.setStackTrace(cause.getStackTrace()); return translated; }
public CommandInvoker<?, ?> resolve(String s) throws ScriptException, IOException { // A bit nasty : will improve that later CRaSHSession session = (CRaSHSession)getSession(); PipeLineParser parser= new PipeLineParser(s); PipeLineFactory factory = parser.parse(); try { return factory.create(session); } catch (NoSuchCommandException e) { throw new ScriptException(e); } }
break; } else { throw new ScriptException("Language " + name + " does not provide a repl"); throw new ScriptException("Language " + name + " not active"); context.provide("Using repl " + name); } else { throw new ScriptException("Repl " + name + " not found");
break; } else { throw new ScriptException("Language " + name + " does not provide a repl"); throw new ScriptException("Language " + name + " not active"); context.provide("Using repl " + name); } else { throw new ScriptException("Repl " + name + " not found");