DatabaseErrorCode enum

The failure codes of a FirebaseDatabaseException, as a type you can switch on, with the public kebab-case code of each.

FirebaseDatabaseException.errorCode returns one. userCodeException is internal: a throwing transaction handler fails with its own error object, so it does not reach a caller as an exception.

New values may be added in any minor release: a switch over this enum needs a default (or wildcard) branch.

Inheritance
Available extensions

Values

dataStale → const DatabaseErrorCode

The transaction needs to be run again with current data.

const DatabaseErrorCode('data-stale', 'datastale')
operationFailed → const DatabaseErrorCode

The server indicated that this operation failed.

const DatabaseErrorCode('operation-failed', 'failure')
permissionDenied → const DatabaseErrorCode

The client does not have permission to perform this operation.

const DatabaseErrorCode('permission-denied', 'permission_denied')
disconnected → const DatabaseErrorCode

The operation had to be aborted due to a network disconnect.

const DatabaseErrorCode('disconnected', 'disconnected')
maxRetries → const DatabaseErrorCode

The transaction had too many retries.

const DatabaseErrorCode('max-retries', 'maxretries')
overriddenBySet → const DatabaseErrorCode

The transaction was overridden by a subsequent set.

const DatabaseErrorCode('overridden-by-set', 'overriddenbyset')
unavailable → const DatabaseErrorCode

The service is unavailable.

const DatabaseErrorCode('unavailable', 'unavailable')
tooBig → const DatabaseErrorCode

The requested data exceeds the maximum size of a single request.

const DatabaseErrorCode('too-big', 'too_big')
userCodeException → const DatabaseErrorCode

An exception occurred in user code (a transaction handler).

const DatabaseErrorCode('user-code-exception', 'user_code_exception')
networkError → const DatabaseErrorCode

The operation could not be performed due to a network error.

const DatabaseErrorCode('network-error', 'network_error')
writeCanceled → const DatabaseErrorCode

The write was canceled by the user (purgeOutstandingWrites).

const DatabaseErrorCode('write-canceled', 'write_canceled')
indexNotDefined → const DatabaseErrorCode

The query orders by a child the security rules give no .indexOn (the server's no_index).

const DatabaseErrorCode('index-not-defined', 'no_index')
databaseClosed → const DatabaseErrorCode

The database instance was closed (or its app deleted); every later asynchronous call fails with this code. Local only: made by the client, never read from the wire (a server status database_closed maps to unknown).

const DatabaseErrorCode('database-closed', 'database_closed')
unknown → const DatabaseErrorCode

An unknown error occurred.

const DatabaseErrorCode('unknown', 'unknown')

Properties

code → String
The public kebab-case code.
final
hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

fromCode(String code) → DatabaseErrorCode
The value for a public code such as permission-denied, or unknown when no value has it.

Constants

values → const List<DatabaseErrorCode>
A constant List of the values in this enum, in order of their declaration.