@Deprecated public class ErrorException extends RuntimeException
RuntimeException implementation that may be used to dispatch errors occurred during
normal execution. A specific error can be identified by its code that can be supplied to each
of constructors provided by this exception class. The specified error code can be than obtained
via getCode().
This exception implementation supports also other common exception related parameters like message and cause.
| Constructor and Description |
|---|
ErrorException(int code)
Deprecated.
Same as
ErrorException(int, String) with empty message. |
ErrorException(int code,
String message)
Deprecated.
Same as
ErrorException(int, String, Throwable) with null throwable cause. |
ErrorException(int code,
String message,
Throwable cause)
Deprecated.
Creates a new instance of ErrorException with the specified error code, message
and cause.
|
ErrorException(int code,
Throwable cause)
Deprecated.
Same as
ErrorException(int, String, Throwable) with empty message. |
| Modifier and Type | Method and Description |
|---|---|
int |
getCode()
Deprecated.
Returns the error code specified for this error exception.
|
static ErrorException |
withCode(int code)
Deprecated.
Creates a new instance of ErrorException with the specified error code.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic ErrorException(int code)
ErrorException(int, String) with empty message.public ErrorException(int code,
@Nullable
String message)
ErrorException(int, String, Throwable) with null throwable cause.public ErrorException(int code,
@Nullable
Throwable cause)
ErrorException(int, String, Throwable) with empty message.public ErrorException(int code,
@Nullable
String message,
@Nullable
Throwable cause)
code - The desired error code for the error exception.message - The desired message for the error exception. May be null.cause - The desired throwable cause for the error exception. May be null.@NonNull public static ErrorException withCode(int code)
code - The desired error code with which to create the error exception.public final int getCode()