Package software.amazon.smithy.cli
Class CliError
- java.lang.Object
- 
- java.lang.Throwable
- 
- java.lang.Exception
- 
- java.lang.RuntimeException
- 
- software.amazon.smithy.cli.CliError
 
 
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 
 public final class CliError extends java.lang.RuntimeExceptionThrow this exception to cause the CLI to exit with a message and code.- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description intcode
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static CliErrorwrap(java.lang.Throwable e)Wraps the given exception in a CliError (no wrapping is performed if the given exception is an instance of CliError).
 
- 
- 
- 
Constructor Detail- 
CliErrorpublic CliError(java.lang.String message) Exits the CLI with a message and an error code of 1.- Parameters:
- message- Message to output.
 
 - 
CliErrorpublic CliError(java.lang.String message, int code)- Parameters:
- message- Message to use in the exception.
- code- Exit code to set.
 
 - 
CliErrorpublic CliError(java.lang.String message, int code, java.lang.Throwable previous)- Parameters:
- message- Message to use in the exception.
- code- Exit code to set.
- previous- Previous exception.
 
 
- 
 - 
Method Detail- 
wrappublic static CliError wrap(java.lang.Throwable e) Wraps the given exception in a CliError (no wrapping is performed if the given exception is an instance of CliError).- Parameters:
- e- Exception to wrap.
- Returns:
- Returns the wrapped exception.
 
 
- 
 
-