Class CommandLine.DefaultExceptionHandler<R>

java.lang.Object
nz.org.riskscape.picocli.CommandLine.AbstractHandler<R,CommandLine.DefaultExceptionHandler<R>>
nz.org.riskscape.picocli.CommandLine.DefaultExceptionHandler<R>
All Implemented Interfaces:
CommandLine.IExceptionHandler, CommandLine.IExceptionHandler2<R>
Enclosing class:
CommandLine

@Deprecated public static class CommandLine.DefaultExceptionHandler<R> extends CommandLine.AbstractHandler<R,CommandLine.DefaultExceptionHandler<R>> implements CommandLine.IExceptionHandler, CommandLine.IExceptionHandler2<R>

Default exception handler that handles invalid user input by printing the exception message, followed by the usage message for the command or subcommand whose input was invalid.

ParameterExceptions (invalid user input) is handled like this:

      err().println(paramException.getMessage());
      paramException.getCommandLine().usage(err(), ansi());
      if (hasExitCode()) System.exit(exitCode()); else return returnValue;
  

ExecutionExceptions that occurred while executing the Runnable or Callable command are simply rethrown and not handled.