public class ObjectServerError extends RuntimeException
getErrorCode()
is guaranteed to contain a value. If the error was caused by an underlying exception
getErrorMessage()
is null
and getException()
is set, while if the error was a protocol error
getErrorMessage()
is set and getException()
is null.for a list of possible errors.
,
Serialized FormConstructor and Description |
---|
ObjectServerError(ErrorCode errorCode,
String errorMessage)
Create an error caused by an error in the protocol when communicating with the Object Server.
|
ObjectServerError(ErrorCode errorCode,
String nativeErrorType,
int nativeErrorCode,
String errorMessage,
Throwable exception) |
ObjectServerError(ErrorCode errorCode,
String title,
String hint)
Errors happening while trying to authenticate a user.
|
ObjectServerError(ErrorCode errorCode,
String errorMessage,
Throwable exception)
Generic error happening that could happen anywhere.
|
ObjectServerError(ErrorCode errorCode,
Throwable exception)
Create an error caused by an an exception when communicating with the Object Server.
|
ObjectServerError(String errorType,
int errorCode,
String errorMessage)
Creates an unknown error that could not be mapped to any known error case.
|
Modifier and Type | Method and Description |
---|---|
ErrorCode.Category |
getCategory()
Returns the
ErrorCode.Category category for this error. |
ErrorCode |
getErrorCode()
Returns the
ErrorCode identifying the type of error. |
int |
getErrorIntValue()
Returns an integer representing this specific type of error.
|
String |
getErrorMessage()
Returns a more detailed error message about the cause of this error.
|
String |
getErrorType()
Returns a string describing the type of error it is.
|
Throwable |
getException()
Returns the underlying exception causing this error, if any.
|
String |
toString() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public ObjectServerError(ErrorCode errorCode, String errorMessage)
errorCode
- error code for this type of error.errorMessage
- detailed error message.public ObjectServerError(String errorType, int errorCode, String errorMessage)
This means that getErrorCode()
will return ErrorCode.UNKNOWN
, but
getErrorType()
and getErrorIntValue()
will return the underlying values
which can help identify the real error.
errorCode
- error code for this type of error.errorMessage
- detailed error message.public ObjectServerError(ErrorCode errorCode, Throwable exception)
errorCode
- error code for this type of error.exception
- underlying exception causing this error.public ObjectServerError(ErrorCode errorCode, String title, String hint)
errorCode
- error code for this type of error.title
- title for this type of error.hint
- a hint for resolving the error.public ObjectServerError(ErrorCode errorCode, String errorMessage, Throwable exception)
errorCode
- error code for this type of error.errorMessage
- detailed error message.exception
- underlying exception if the error was caused by this.public ErrorCode getErrorCode()
ErrorCode
identifying the type of error.
If ErrorCode.UNKNOWN
is returned, it means that the error could not be mapped to any
known errors. In that case getErrorType()
and getErrorIntValue()
will
return the underlying error information which can better identify the type of error.
ErrorCode
public String getErrorType()
public int getErrorIntValue()
getErrorType()
.public String getErrorMessage()
null
if one was not available.public Throwable getException()
null
if not caused by an exception.public ErrorCode.Category getCategory()
ErrorCode.Category
category for this error.
Errors that are ErrorCode.Category.RECOVERABLE
mean that it is still possible for a
given SyncSession
to resume synchronization. ErrorCode.Category.FATAL
errors
means that session has stopped and cannot be recovered.