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:
 Serializable
Throw this exception to cause the CLI to exit with a message and code.
- See Also:
 
- 
Field Summary
Fields - 
Constructor Summary
Constructors - 
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString 
- 
Field Details
- 
code
public final int code 
 - 
 - 
Constructor Details
- 
CliError
Exits the CLI with a message and an error code of 1.- Parameters:
 message- Message to output.
 - 
CliError
- Parameters:
 message- Message to use in the exception.code- Exit code to set.
 - 
CliError
- Parameters:
 message- Message to use in the exception.code- Exit code to set.previous- Previous exception.
 
 - 
 - 
Method Details
- 
wrap
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.
 
 
 -