Class ServiceLaunchException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.hadoop.util.ExitUtil.ExitException
org.apache.hadoop.service.launcher.ServiceLaunchException
All Implemented Interfaces:
Serializable, LauncherExitCodes, org.apache.hadoop.util.ExitCodeProvider

@Public @Evolving public class ServiceLaunchException extends org.apache.hadoop.util.ExitUtil.ExitException implements org.apache.hadoop.util.ExitCodeProvider, LauncherExitCodes
A service launch exception that includes an exit code.

When caught by the ServiceLauncher, it will convert that into a process exit code. The ServiceLaunchException(int, String, Object...) constructor generates formatted exceptions.

See Also:
  • Constructor Details

    • ServiceLaunchException

      public ServiceLaunchException(int exitCode, Throwable cause)
      Create an exception with the specific exit code.
      Parameters:
      exitCode - exit code
      cause - cause of the exception
    • ServiceLaunchException

      public ServiceLaunchException(int exitCode, String message)
      Create an exception with the specific exit code and text.
      Parameters:
      exitCode - exit code
      message - message to use in exception
    • ServiceLaunchException

      public ServiceLaunchException(int exitCode, String format, Object... args)
      Create a formatted exception.

      This uses String.format(String, Object...) to build the formatted exception in the ENGLISH locale.

      If the last argument is a throwable, it becomes the cause of the exception. It will also be used as a parameter for the format.

      Parameters:
      exitCode - exit code
      format - format for message to use in exception
      args - list of arguments
    • ServiceLaunchException

      public ServiceLaunchException(int exitCode, Throwable cause, String format, Object... args)
      Create a formatted exception.

      This uses String.format(String, Object...) to build the formatted exception in the ENGLISH locale.

      Parameters:
      exitCode - exit code
      cause - inner cause
      format - format for message to use in exception
      args - list of arguments