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 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.
|
Modifier and Type | Method and Description |
---|---|
ErrorCode.Category |
getCategory()
Returns the
ErrorCode.Category category for this error. |
ErrorCode |
getErrorCode()
Returns the error code uniquely identifying this type of error.
|
String |
getErrorMessage()
Returns a more detailed error message about the cause of this error.
|
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(ErrorCode errorCode, Throwable exception)
errorCode
- error code for this type of error.exception
- underlying exception causing this 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
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.