Tabnine Logo
CommandLine$ExecutionException.getCommandLine
Code IndexAdd Tabnine to your IDE (free)

How to use
getCommandLine
method
in
picocli.CommandLine$ExecutionException

Best Java code snippets using picocli.CommandLine$ExecutionException.getCommandLine (Showing top 3 results out of 315)

origin: remkop/picocli

@Test
public void testCall1DefaultExceptionHandlerRethrows() {
  try {
    CommandLine.call(new MyCallable(), "-x abc");
  } catch (ExecutionException ex) {
    String cmd = ex.getCommandLine().getCommand().toString();
    String msg = "Error while calling command (" + cmd + "): java.lang.IllegalStateException: this is a test";
    assertEquals(msg, ex.getMessage());
  }
  assertEquals("", systemErrRule.getLog());
  assertEquals("", systemOutRule.getLog());
}
origin: hazelcast/hazelcast-jet

  @Override
  public R handleExecutionException(ExecutionException ex, ParseResult parseResult) {
    // find top level command
    CommandLine cmdLine = ex.getCommandLine();
    while (cmdLine.getParent() != null) {
      cmdLine = cmdLine.getParent();
    }
    JetCommandLine jetCmd = cmdLine.getCommand();
    if (jetCmd.isVerbose) {
      ex.printStackTrace(err());
    } else {
      err().println("ERROR: " + ex.getCause().getMessage());
      err().println();
      err().println("To see the full stack trace, re-run with the -v/--verbose option");
    }
    if (hasExitCode()) {
      exit(exitCode());
    }
    throw ex;
  }
}
origin: info.picocli/picocli

@Test
public void testCall1DefaultExceptionHandlerRethrows() {
  try {
    CommandLine.call(new MyCallable(), "-x abc");
  } catch (ExecutionException ex) {
    String cmd = ex.getCommandLine().getCommand().toString();
    String msg = "Error while calling command (" + cmd + "): java.lang.IllegalStateException: this is a test";
    assertEquals(msg, ex.getMessage());
  }
  assertEquals("", systemErrRule.getLog());
  assertEquals("", systemOutRule.getLog());
}
picocliCommandLine$ExecutionExceptiongetCommandLine

Javadoc

Returns the CommandLine object for the (sub)command that could not be invoked.

Popular methods of CommandLine$ExecutionException

  • <init>
  • getCause
  • getMessage
  • printStackTrace

Popular in Java

  • Start an intent from android
  • findViewById (Activity)
  • onCreateOptionsMenu (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Path (java.nio.file)
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Notification (javax.management)
  • JList (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now