Docs Menu

Docs HomeDevelop ApplicationsAtlas Device SDKs

Exception AppException

On this page

  • io.realm.mongodb
  • Constructors
  • Method Summary
  • Inherited Methods
  • Constructor Detail
  • Method Detail
  • getCategory
  • getErrorCode
  • getErrorIntValue
  • getErrorMessage
  • getErrorType
  • getException
  • toString

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.

Tip

See also:

Constructor and Description
ErrorCode errorCode,
String errorMessage
)

Create an error caused by an error in the protocol when communicating with the Object Server.

String errorType,
int errorCode,
String errorMessage
)

Creates an unknown error that could not be mapped to any known error case.

ErrorCode errorCode,
Throwable exception
)

Create an error caused by an an exception when communicating with the Object Server.

ErrorCode errorCode,
String title,
String hint
)

Errors happening while trying to authenticate a user.

ErrorCode errorCode,
String errorMessage,
Throwable exception
)

Generic error happening that could happen anywhere.

ErrorCode errorCode,
String nativeErrorType,
int nativeErrorCode,
String errorMessage,
Throwable exception
)
Modifier and Type
Method and Description

Returns the ErrorCode.Category category for this error.

public ErrorCode

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

Returns a string describing the type of error it is.

public Throwable

Returns the underlying exception causing this error, if any.

public String
  • 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

public AppException (
ErrorCode errorCode,
String errorMessage
)

Create an error caused by an error in the protocol when communicating with the Object Server.

Parameters

  • errorCode - error code for this type of error.

  • errorMessage - detailed error message.

public AppException (
String errorType,
int errorCode,
String errorMessage
)

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

  • errorCode - error code for this type of error.

  • errorMessage - detailed error message.

public AppException (
ErrorCode errorCode,
Throwable exception
)

Create an error caused by an an exception when communicating with the Object Server.

Parameters

  • errorCode - error code for this type of error.

  • exception - underlying exception causing this error.

public AppException (
ErrorCode errorCode,
String title,
String hint
)

Errors happening while trying to authenticate a user.

Parameters

  • errorCode - error code for this type of error.

  • title - title for this type of error.

  • hint - a hint for resolving the error.

public AppException (
ErrorCode errorCode,
String errorMessage,
Throwable exception
)

Generic error happening that could happen anywhere.

Parameters

  • errorCode - error code for this type of error.

  • errorMessage - detailed error message.

  • exception - underlying exception if the error was caused by this.

public AppException (
ErrorCode errorCode,
String nativeErrorType,
int nativeErrorCode,
String errorMessage,
Throwable exception
)

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.

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.

Tip

See also:

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.

Returns a more detailed error message about the cause of this error.

Returns

a detailed error message or null if one was not available.

Returns a string describing the type of error it is.

Returns

Returns the underlying exception causing this error, if any.

Returns

the underlying exception causing this error, or null if not caused by an exception.

public String toString ()

Overrides

toString in class Throwable

← Class UserProfile