Package picocli

Class CommandLine.ExecutionException

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    CommandLine

    public static class CommandLine.ExecutionException
    extends CommandLine.PicocliException
    Exception indicating a problem while invoking a command or subcommand. Keeps a reference to the CommandLine object where the cause exception occurred, so that client code can tailor their handling for the specific command (print the command's usage help message, for example).
    Since:
    2.0
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CommandLine getCommandLine()
      Returns the CommandLine object for the (sub)command that could not be invoked.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ExecutionException

        public ExecutionException​(CommandLine commandLine,
                                  java.lang.String msg)
      • ExecutionException

        public ExecutionException​(CommandLine commandLine,
                                  java.lang.String msg,
                                  java.lang.Throwable t)
    • Method Detail

      • getCommandLine

        public CommandLine getCommandLine()
        Returns the CommandLine object for the (sub)command that could not be invoked.
        Returns:
        the CommandLine object for the (sub)command where invocation failed.