Package nz.org.riskscape.engine.cli
Class ExitException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
nz.org.riskscape.engine.RiskscapeException
nz.org.riskscape.engine.cli.ExitException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
InvalidUsageException
,ReadlineInterruptedException
Throw when there is some issue with the command that deserves an error message to the user along with potentially a non-zero exit
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Problem
Magic problem that indicates that there wasn't a problem related to this exit exception, such as when the user just wants to quit -
Constructor Summary
ConstructorDescriptionExitException
(int exitCode, String message, Object... formatArgs) ExitException
(int exitCode, String message, List<Problem> problems) ExitException
(int exitCode, Throwable cause, String message, Object... formatArgs) ExitException
(int exitCode, Problem problem) ExitException
(Problem problem) ExitException
(Problem problem, Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
quit()
Throw anExitException
that will cause riskscape to exit immediately without errortoExitCode
(Messages messages) Methods inherited from class nz.org.riskscape.engine.RiskscapeException
getCause, getProblem, hasProblem
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
NO_PROBLEM
Magic problem that indicates that there wasn't a problem related to this exit exception, such as when the user just wants to quit
-
-
Constructor Details
-
ExitException
-
ExitException
-
ExitException
-
ExitException
-
ExitException
-
ExitException
- Parameters:
exitCode
- the exit code to exit(int) withcause
- a reason for the exit, can be nullmessage
- a message to print out on to the command line, first argument toString.format(String, Object...)
formatArgs
- parameters to interpolate in the the message, second argument toString.format(String, Object...)
-
-
Method Details
-
quit
public static void quit()Throw an
ExitException
that will cause riskscape to exit immediately without error -
toExitCode
-