@InterfaceAudience.Public @InterfaceStability.Evolving public class ServiceStateException extends RuntimeException implements org.apache.hadoop.util.ExitCodeProvider
LauncherExitCodes.EXIT_SERVICE_LIFECYCLE_EXCEPTION
.Constructor and Description |
---|
ServiceStateException(int exitCode,
String message,
Throwable cause)
Instantiate, using the specified exit code as the exit code
of the exception, irrespetive of any exit code supplied by any inner
cause.
|
ServiceStateException(String message)
Instantiate
|
ServiceStateException(String message,
Throwable cause)
Instantiate with a message and cause; if the cause has an exit code
then it is used, otherwise the generic
LauncherExitCodes.EXIT_SERVICE_LIFECYCLE_EXCEPTION exit code
is used. |
ServiceStateException(Throwable cause) |
Modifier and Type | Method and Description |
---|---|
static RuntimeException |
convert(String text,
Throwable fault)
Convert any exception into a
RuntimeException . |
static RuntimeException |
convert(Throwable fault)
Convert any exception into a
RuntimeException . |
int |
getExitCode()
Method to get the exit code.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public ServiceStateException(String message)
message
- error messagepublic ServiceStateException(String message, Throwable cause)
LauncherExitCodes.EXIT_SERVICE_LIFECYCLE_EXCEPTION
exit code
is used.message
- exception messagecause
- optional inner causepublic ServiceStateException(int exitCode, String message, Throwable cause)
exitCode
- exit code to declaremessage
- exception messagecause
- inner causepublic ServiceStateException(Throwable cause)
public int getExitCode()
org.apache.hadoop.util.ExitCodeProvider
getExitCode
in interface org.apache.hadoop.util.ExitCodeProvider
public static RuntimeException convert(Throwable fault)
RuntimeException
.
All other exception types are wrapped in a new instance of
ServiceStateException
.fault
- exception or throwableRuntimeException
to rethrowpublic static RuntimeException convert(String text, Throwable fault)
RuntimeException
.
If the caught exception is already of that type, it is typecast to a
RuntimeException
and returned.
All other exception types are wrapped in a new instance of
ServiceStateException
.text
- text to use if a new exception is createdfault
- exception or throwableRuntimeException
to rethrowCopyright © 2024 Apache Software Foundation. All rights reserved.