Class ExitException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
InvalidUsageException, ReadlineInterruptedException

public class ExitException extends RiskscapeException

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 Details

    • NO_PROBLEM

      public static final Problem 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

      public ExitException(int exitCode, String message, Object... formatArgs)
    • ExitException

      public ExitException(int exitCode, String message, List<Problem> problems)
    • ExitException

      public ExitException(int exitCode, Problem problem)
    • ExitException

      public ExitException(Problem problem)
    • ExitException

      public ExitException(Problem problem, Throwable cause)
    • ExitException

      public ExitException(int exitCode, Throwable cause, String message, Object... formatArgs)
      Parameters:
      exitCode - the exit code to exit(int) with
      cause - a reason for the exit, can be null
      message - a message to print out on to the command line, first argument to String.format(String, Object...)
      formatArgs - parameters to interpolate in the the message, second argument to String.format(String, Object...)
  • Method Details

    • quit

      public static void quit()

      Throw an ExitException that will cause riskscape to exit immediately without error

    • toExitCode

      public ExitCode toExitCode(Messages messages)