The operation had to be aborted due to a network disconnect.
Constant Value:
-4
public
static
final
int
EXPIRED_TOKEN
The supplied auth token has expired.
Constant Value:
-6
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.
Constant Value:
-7
public
static
final
int
MAX_RETRIES
The transaction had too many retries
Constant Value:
-8
public
static
final
int
NETWORK_ERROR
The operation could not be performed due to a network error.
Constant Value:
-24
public
static
final
int
OPERATION_FAILED
The server indicated that this operation failed.
Constant Value:
-2
public
static
final
int
OVERRIDDEN_BY_SET
The transaction was overridden by a subsequent set
Constant Value:
-9
public
static
final
int
PERMISSION_DENIED
This client does not have permission to perform this operation.
Constant Value:
-3
public
static
final
int
UNAVAILABLE
The service is unavailable.
Constant Value:
-10
public
static
final
int
UNKNOWN_ERROR
An unknown error occurred. Please refer to the error message and error details for more
information.
Constant Value:
-999
public
static
final
int
USER_CODE_EXCEPTION
An exception occurred in user code.
Constant Value:
-11
public
static
final
int
WRITE_CANCELED
The write was canceled locally.
Constant Value:
-25
Public Methods
public
static
DatabaseErrorfromException(Throwable e)
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;
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-04-28 UTC."],[],[],null,["# DatabaseError\n\npublic class **DatabaseError** extends Object \nInstances of DatabaseError are passed to callbacks when an operation failed. They contain a\ndescription of the specific error that occurred. \n\n### Constant Summary\n\n|-----|----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|\n| int | [DATA_STALE](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#DATA_STALE) | **Internal use.** |\n| int | [DISCONNECTED](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#DISCONNECTED) | The operation had to be aborted due to a network disconnect. |\n| int | [EXPIRED_TOKEN](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#EXPIRED_TOKEN) | The supplied auth token has expired. |\n| int | [INVALID_TOKEN](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#INVALID_TOKEN) | The specified authentication token is invalid. |\n| int | [MAX_RETRIES](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#MAX_RETRIES) | The transaction had too many retries |\n| int | [NETWORK_ERROR](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#NETWORK_ERROR) | The operation could not be performed due to a network error. |\n| int | [OPERATION_FAILED](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#OPERATION_FAILED) | The server indicated that this operation failed. |\n| int | [OVERRIDDEN_BY_SET](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#OVERRIDDEN_BY_SET) | The transaction was overridden by a subsequent set |\n| int | [PERMISSION_DENIED](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#PERMISSION_DENIED) | This client does not have permission to perform this operation. |\n| int | [UNAVAILABLE](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#UNAVAILABLE) | The service is unavailable. |\n| int | [UNKNOWN_ERROR](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#UNKNOWN_ERROR) | An unknown error occurred. |\n| int | [USER_CODE_EXCEPTION](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#USER_CODE_EXCEPTION) | An exception occurred in user code. |\n| int | [WRITE_CANCELED](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#WRITE_CANCELED) | The write was canceled locally. |\n\n### Public Method Summary\n\n|----------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [DatabaseError](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError) | [fromException](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#fromException(java.lang.Throwable))(Throwable e) |\n| int | [getCode](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#getCode())() |\n| String | [getDetails](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#getDetails())() |\n| String | [getMessage](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#getMessage())() |\n| [DatabaseException](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseException) | [toException](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#toException())() Can be used if a third party needs an Exception from Firebase Database for integration purposes. |\n| String | [toString](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError#toString())() |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|------------------|---------------------------|\n| Object | clone() |\n| boolean | equals(Object arg0) |\n| void | finalize() |\n| final Class\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| String | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nConstants\n---------\n\n#### public static final int\n**DATA_STALE**\n\n**Internal use.** \nConstant Value: -1 \n\n#### public static final int\n**DISCONNECTED**\n\nThe operation had to be aborted due to a network disconnect. \nConstant Value: -4 \n\n#### public static final int\n**EXPIRED_TOKEN**\n\nThe supplied auth token has expired. \nConstant Value: -6 \n\n#### public static final int\n**INVALID_TOKEN**\n\nThe specified authentication token is invalid. This can occur when the token is malformed,\nexpired, or the secret that was used to generate it has been revoked. \nConstant Value: -7 \n\n#### public static final int\n**MAX_RETRIES**\n\nThe transaction had too many retries \nConstant Value: -8 \n\n#### public static final int\n**NETWORK_ERROR**\n\nThe operation could not be performed due to a network error. \nConstant Value: -24 \n\n#### public static final int\n**OPERATION_FAILED**\n\nThe server indicated that this operation failed. \nConstant Value: -2 \n\n#### public static final int\n**OVERRIDDEN_BY_SET**\n\nThe transaction was overridden by a subsequent set \nConstant Value: -9 \n\n#### public static final int\n**PERMISSION_DENIED**\n\nThis client does not have permission to perform this operation. \nConstant Value: -3 \n\n#### public static final int\n**UNAVAILABLE**\n\nThe service is unavailable. \nConstant Value: -10 \n\n#### public static final int\n**UNKNOWN_ERROR**\n\nAn unknown error occurred. Please refer to the error message and error details for more\ninformation. \nConstant Value: -999 \n\n#### public static final int\n**USER_CODE_EXCEPTION**\n\nAn exception occurred in user code. \nConstant Value: -11 \n\n#### public static final int\n**WRITE_CANCELED**\n\nThe write was canceled locally. \nConstant Value: -25\n\nPublic Methods\n--------------\n\n#### public static [DatabaseError](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseError)\n**fromException**\n(Throwable e)\n\n\u003cbr /\u003e\n\n#### public int\n**getCode**\n()\n\n\u003cbr /\u003e\n\n##### Returns\n\n- One of the defined status codes, depending on the error. \n\n#### public String\n**getDetails**\n()\n\n\u003cbr /\u003e\n\n##### Returns\n\n- Human-readable details on the error and additional information, e.g. links to docs; \n\n#### public String\n**getMessage**\n()\n\n\u003cbr /\u003e\n\n##### Returns\n\n- A human-readable description of the error. \n\n#### public [DatabaseException](/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseException)\n**toException**\n()\n\nCan be used if a third party needs an Exception from Firebase Database for integration\npurposes. \n\n##### Returns\n\n- An exception wrapping this error, with an appropriate message and no stack trace. \n\n#### public String\n**toString**\n()\n\n\u003cbr /\u003e"]]