Codota Logo
ScriptException
Code IndexAdd Codota to your IDE (free)

How to use
ScriptException
in
org.crsh.command

Best Java code snippets using org.crsh.command.ScriptException (Showing top 11 results out of 315)

  • Common ways to obtain ScriptException
private void myMethod () {
ScriptException s =
  • Codota Iconnew ScriptException()
  • Codota IconString message;new ScriptException(message)
  • Smart code suggestions by Codota
}
origin: crashub/crash

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;
}
origin: crashub/crash

 @Command
 public String main() {
  throw new org.crsh.command.ScriptException();
 }
}
origin: crashub/crash

public void testConsumerThrowsScriptExceptionInProvide() throws Exception {
 String consumer =
   "class producer {\n" +
     "  @Command\n" +
     "  public org.crsh.command.Pipe<Integer, Object> main() {\n" +
     "    return new org.crsh.command.Pipe<Integer, Object>() {\n" +
     "      public void provide(Integer element) {\n" +
     "        throw new org.crsh.command.ScriptException('foo')\n" +
     "      }\n" +
     "    };\n" +
     "  }\n" +
     "}\n";
 lifeCycle.bindClass("producer", Commands.ProduceInteger.class);
 lifeCycle.bindGroovy("consumer", consumer);
 Commands.list.clear();
 Throwable t = assertError("producer | consumer", ErrorKind.EVALUATION);
 ScriptException ex = assertInstance(ScriptException.class, t);
 assertEquals("foo", ex.getMessage());
}
origin: org.crsh/crsh.shell.core

Object dispatch(String methodName, Object[] arguments) {
 PipeCommandProxy pipe = resolvePipe(methodName, arguments, false);
 //
 try {
  pipe.fire();
  return null;
 }
 catch (ScriptException e) {
  Throwable cause = e.getCause();
  if (cause != null) {
   throw new InvokerInvocationException(cause);
  } else {
   throw e;
  }
 }
 finally {
  Safe.close(pipe);
 }
}
origin: crashub/crash

    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");
origin: org.crsh/crsh.shell.core

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);
 }
}
origin: org.crsh/crsh.shell.core

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);
 }
}
origin: org.crashub/crash.shell

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;
}
origin: org.crashub/crash.shell

    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");
origin: com.github.corda.crash/crash.shell

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;
}
origin: com.github.corda.crash/crash.shell

    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");
org.crsh.commandScriptException

Javadoc

Base command thrown during the execution of a command.

Most used methods

  • <init>
  • setStackTrace
  • getCause
  • getMessage

Popular in Java

  • Reactive rest calls using spring rest template
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now