public class DOFException extends java.lang.Exception implements org.opendof.core.internal.protocol.Marshallable, DOFImmutable
Modifier and Type | Field and Description |
---|---|
static int |
FAILED
General failure (no specific error code applies).
|
Modifier and Type | Method and Description |
---|---|
static DOFErrorException |
create(int errorCode,
java.lang.String message,
java.lang.Throwable cause)
Create a DOFException using an error code, an error message, and a cause.
|
int |
getErrorCode()
Get the error code for this exception.
|
java.lang.String |
getErrorCodeString(int errorCode)
Get a String representation of an error code.
|
java.lang.String |
getMessage()
Gets a message that describes the conditions of this exception.
|
DOFProviderInfo |
getProviderInfo()
Returns information about the provider that threw this exception, if any.
|
void |
marshal(DOFMarshalContext context,
java.lang.Object state,
DOFPacket packet)
Write an object to a serialized form to the specified buffer, according
to the context specified and with the given state.
|
java.lang.String |
toString()
Get a string representation of this object.
|
public static final int FAILED
public java.lang.String getErrorCodeString(int errorCode)
errorCode
- The error code to convert to a String.public int getErrorCode()
public DOFProviderInfo getProviderInfo()
public java.lang.String toString()
toString
in class java.lang.Throwable
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public static DOFErrorException create(int errorCode, java.lang.String message, java.lang.Throwable cause)
errorCode
- The error code for this exception.message
- The error message for this exception (see getMessage()
). May be null.cause
- The original cause of the exception. May be null.public void marshal(DOFMarshalContext context, java.lang.Object state, DOFPacket packet) throws DOFMarshalException
marshal
in interface org.opendof.core.internal.protocol.Marshallable
context
- The context of the marshaling to be performed.state
- The state in which the marshalling is done. This may affect the result.
For this class, the state is a providerID (DOFObjectID).packet
- The buffer which will receive the marshaled data. Must not be null.DOFMarshalException
- If there are errors in the data or the buffer.