Class CommandException
- java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- java.lang.RuntimeException
- org.springframework.boot.cli.command.CommandException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
NoHelpCommandArgumentsException,NoSuchCommandException,ShellExitException,TestFailedException
public class CommandException extends RuntimeException
Runtime exception wrapper that defines additionalCommandException.Options that are understood by theCommandRunner.- See Also:
- Serialized Form
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCommandException.OptionSpecific options understood by theCommandRunner.
Constructor Summary
Constructors Constructor Description CommandException(String message, Throwable cause, CommandException.Option... options)Create a newCommandExceptionwith the specified options.CommandException(String message, CommandException.Option... options)Create a newCommandExceptionwith the specified options.CommandException(Throwable cause, CommandException.Option... options)Create a newCommandExceptionwith the specified options.CommandException(CommandException.Option... options)Create a newCommandExceptionwith the specified options.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<CommandException.Option>getOptions()Returns a set of options that are understood by theCommandRunner.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Constructor Detail
CommandException
public CommandException(CommandException.Option... options)
Create a newCommandExceptionwith the specified options.- Parameters:
options- the exception options
CommandException
public CommandException(String message, CommandException.Option... options)
Create a newCommandExceptionwith the specified options.- Parameters:
message- the exception message to display to the useroptions- the exception options
CommandException
public CommandException(String message, Throwable cause, CommandException.Option... options)
Create a newCommandExceptionwith the specified options.- Parameters:
message- the exception message to display to the usercause- the underlying causeoptions- the exception options
CommandException
public CommandException(Throwable cause, CommandException.Option... options)
Create a newCommandExceptionwith the specified options.- Parameters:
cause- the underlying causeoptions- the exception options
Method Detail
getOptions
public Set<CommandException.Option> getOptions()
Returns a set of options that are understood by theCommandRunner.- Returns:
- the options understood by the runner