Instances of DatabaseError are passed to callbacks when an operation failed. They contain a description of the specific error that occurred.
Constant Summary
int | DATA_STALE | Internal use. |
int | DISCONNECTED | The operation had to be aborted due to a network disconnect. |
int | EXPIRED_TOKEN | The supplied auth token has expired. |
int | INVALID_TOKEN | The specified authentication token is invalid. |
int | MAX_RETRIES | The transaction had too many retries |
int | NETWORK_ERROR | The operation could not be performed due to a network error. |
int | OPERATION_FAILED | The server indicated that this operation failed. |
int | OVERRIDDEN_BY_SET | The transaction was overridden by a subsequent set |
int | PERMISSION_DENIED | This client does not have permission to perform this operation. |
int | UNAVAILABLE | The service is unavailable. |
int | UNKNOWN_ERROR | An unknown error occurred. |
int | USER_CODE_EXCEPTION | An exception occurred in user code. |
int | WRITE_CANCELED | The write was canceled locally. |
Public Method Summary
static DatabaseError |
fromException(Throwable e)
|
int |
getCode()
|
String | |
String | |
DatabaseException |
toException()
Can be used if a third party needs an Exception from Firebase Database for integration
purposes.
|
String |
toString()
|
Inherited Method Summary
Constants
public static final int DATA_STALE
Internal use.
public static final int DISCONNECTED
The operation had to be aborted due to a network disconnect.
public static final int EXPIRED_TOKEN
The supplied auth token has expired.
public static final int INVALID_TOKEN
The specified authentication token is invalid. This can occur when the token is malformed, expired, or the secret that was used to generate it has been revoked.
public static final int MAX_RETRIES
The transaction had too many retries
public static final int NETWORK_ERROR
The operation could not be performed due to a network error.
public static final int OPERATION_FAILED
The server indicated that this operation failed.
public static final int OVERRIDDEN_BY_SET
The transaction was overridden by a subsequent set
public static final int PERMISSION_DENIED
This client does not have permission to perform this operation.
public static final int UNAVAILABLE
The service is unavailable.
public static final int UNKNOWN_ERROR
An unknown error occurred. Please refer to the error message and error details for more information.
public static final int USER_CODE_EXCEPTION
An exception occurred in user code.
public static final int WRITE_CANCELED
The write was canceled locally.
Public Methods
public int getCode ()
Returns
- One of the defined status codes, depending on the error.
public String getDetails ()
Returns
- Human-readable details on the error and additional information, e.g. links to docs;
public String getMessage ()
Returns
- A human-readable description of the error.
public DatabaseException toException ()
Can be used if a third party needs an Exception from Firebase Database for integration purposes.
Returns
- An exception wrapping this error, with an appropriate message and no stack trace.