Exception AppException
On this page
io.realm.mongodb
This class is a wrapper for all errors happening when communicating with a MongoDB Realm app. This include both exceptions and protocol errors. Only 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.
Constructors
Constructor and Description |
---|
Create an error caused by an error in the protocol when communicating with the Object Server. |
Creates an unknown error that could not be mapped to any known error case. |
Create an error caused by an an exception when communicating with the Object Server. |
Errors happening while trying to authenticate a user. |
Generic error happening that could happen anywhere. |
Method Summary
Modifier and Type | Method and Description |
---|---|
public ErrorCode.Category | getCategory () Returns the ErrorCode.Category category for this error. |
public ErrorCode | getErrorCode () Returns the ErrorCode identifying the type of error. |
public int | Returns an integer representing this specific type of error. |
public String | Returns a more detailed error message about the cause of this error. |
public String | getErrorType () Returns a string describing the type of error it is. |
public Throwable | getException () Returns the underlying exception causing this error, if any. |
public String | toString () |
Inherited Methods
Methods inherited from class java.lang.Object :
getClass
,hashCode
,equals
,clone
,toString
,notify
,notifyAll
,wait
,wait
,wait
,finalize
Methods inherited from class java.lang.Throwable :
getMessage
,getLocalizedMessage
,getCause
,initCause
,toString
,printStackTrace
,printStackTrace
,printStackTrace
,fillInStackTrace
,getStackTrace
,setStackTrace
,addSuppressed
,getSuppressed
Constructor Detail
Create an error caused by an error in the protocol when communicating with the Object Server. Parameters
|
Creates an unknown error that could not be mapped to any known error case.This means that getErrorCode() will return ErrorCode.UNKNOWN , but getErrorType() and getErrorIntValue() will return the underlying values which can help identify the real error. Parameters
|
Create an error caused by an an exception when communicating with the Object Server. Parameters
|
Errors happening while trying to authenticate a user. Parameters
|
Generic error happening that could happen anywhere. Parameters
|
public AppException ( ErrorCode errorCode, String nativeErrorType, int nativeErrorCode, String errorMessage, Throwable exception ) |
---|
Method Detail
getCategory
public ErrorCode.Category getCategory () |
---|
Returns the 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. Returns the error category. |
getErrorCode
public ErrorCode getErrorCode () |
---|
Returns the 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. Returns the error code identifying the type of error. |
getErrorIntValue
public int getErrorIntValue () |
---|
Returns an integer representing this specific type of error. This value is only unique within the value provided by getErrorType() . Returns the integer value representing this type of error. |
getErrorMessage
public String getErrorMessage () |
---|
Returns a more detailed error message about the cause of this error. Returns a detailed error message or |
getErrorType
public String getErrorType () |
---|
Returns a string describing the type of error it is. Returns |
getException
public Throwable getException () |
---|
Returns the underlying exception causing this error, if any. Returns the underlying exception causing this error, or |