firebase_admin.exceptions module

Firebase Exceptions module.

This module defines the base types for exceptions and the platform-wide error codes as outlined inhttps://cloud.google.com/apis/design/errors.

FirebaseError is the parent class of all exceptions raised by the Admin SDK. It containsthecode,http_response andcause properties common to all Firebase exception types.Each exception also carries a message that outlines what went wrong. This can be logged foraudit or debugging purposes.

When calling an Admin SDK API, developers can catch the parentFirebaseError andinspect itscode to implement fine-grained error handling. Alternatively, developers cancatch one or more subtypes ofFirebaseError. Under normal conditions, any given API can raiseonly a small subset of the available exception subtypes. However, the SDK also exposes rare errorconditions like connection timeouts and other I/O errors as instances ofFirebaseError.Therefore it is always a good idea to have a handler specified forFirebaseError, after all thesubtype error handlers.

Exceptions

AbortedError

exceptionfirebase_admin.exceptions.AbortedError(message,cause=None,http_response=None)

Bases:FirebaseError

Concurrency conflict, such as read-modify-write conflict.

AlreadyExistsError

exceptionfirebase_admin.exceptions.AlreadyExistsError(message,cause=None,http_response=None)

Bases:FirebaseError

The resource that a client tried to create already exists.

CancelledError

exceptionfirebase_admin.exceptions.CancelledError(message,cause=None,http_response=None)

Bases:FirebaseError

Request cancelled by the client.

ConflictError

exceptionfirebase_admin.exceptions.ConflictError(message,cause=None,http_response=None)

Bases:FirebaseError

Concurrency conflict, such as read-modify-write conflict.

DataLossError

exceptionfirebase_admin.exceptions.DataLossError(message,cause=None,http_response=None)

Bases:FirebaseError

Unrecoverable data loss or data corruption.

DeadlineExceededError

exceptionfirebase_admin.exceptions.DeadlineExceededError(message,cause=None,http_response=None)

Bases:FirebaseError

Request deadline exceeded.

This will happen only if the caller sets a deadline that is shorter than the method’sdefault deadline (i.e. requested deadline is not enough for the server to process therequest) and the request did not finish within the deadline.

FailedPreconditionError

exceptionfirebase_admin.exceptions.FailedPreconditionError(message,cause=None,http_response=None)

Bases:FirebaseError

Request can not be executed in the current system state, such as deleting a non-emptydirectory.

FirebaseError

exceptionfirebase_admin.exceptions.FirebaseError(code,message,cause=None,http_response=None)

Bases:Exception

Base class for all errors raised by the Admin SDK.

Parameters:
propertycause
propertycode
propertyhttp_response

InternalError

exceptionfirebase_admin.exceptions.InternalError(message,cause=None,http_response=None)

Bases:FirebaseError

Internal server error.

InvalidArgumentError

exceptionfirebase_admin.exceptions.InvalidArgumentError(message,cause=None,http_response=None)

Bases:FirebaseError

Client specified an invalid argument.

NotFoundError

exceptionfirebase_admin.exceptions.NotFoundError(message,cause=None,http_response=None)

Bases:FirebaseError

A specified resource is not found, or the request is rejected by undisclosed reasons, suchas whitelisting.

OutOfRangeError

exceptionfirebase_admin.exceptions.OutOfRangeError(message,cause=None,http_response=None)

Bases:FirebaseError

Client specified an invalid range.

PermissionDeniedError

exceptionfirebase_admin.exceptions.PermissionDeniedError(message,cause=None,http_response=None)

Bases:FirebaseError

Client does not have sufficient permission.

This can happen because the OAuth token does not have the right scopes, the client doesn’thave permission, or the API has not been enabled for the client project.

ResourceExhaustedError

exceptionfirebase_admin.exceptions.ResourceExhaustedError(message,cause=None,http_response=None)

Bases:FirebaseError

Either out of resource quota or reaching rate limiting.

UnauthenticatedError

exceptionfirebase_admin.exceptions.UnauthenticatedError(message,cause=None,http_response=None)

Bases:FirebaseError

Request not authenticated due to missing, invalid, or expired OAuth token.

UnavailableError

exceptionfirebase_admin.exceptions.UnavailableError(message,cause=None,http_response=None)

Bases:FirebaseError

Service unavailable. Typically the server is down.

UnknownError

exceptionfirebase_admin.exceptions.UnknownError(message,cause=None,http_response=None)

Bases:FirebaseError

Unknown server error.

Constants

ABORTED

firebase_admin.exceptions.ABORTED='ABORTED'

Error code forAbortedError type.

ALREADY_EXISTS

firebase_admin.exceptions.ALREADY_EXISTS='ALREADY_EXISTS'

Error code forAlreadyExistsError type.

CANCELLED

firebase_admin.exceptions.CANCELLED='CANCELLED'

Error code forCancelledError type.

CONFLICT

firebase_admin.exceptions.CONFLICT='CONFLICT'

Error code forConflictError type.

DATA_LOSS

firebase_admin.exceptions.DATA_LOSS='DATA_LOSS'

Error code forDataLossError type.

DEADLINE_EXCEEDED

firebase_admin.exceptions.DEADLINE_EXCEEDED='DEADLINE_EXCEEDED'

Error code forDeadlineExceededError type.

FAILED_PRECONDITION

firebase_admin.exceptions.FAILED_PRECONDITION='FAILED_PRECONDITION'

Error code forFailedPreconditionError type.

INTERNAL

firebase_admin.exceptions.INTERNAL='INTERNAL'

Error code forInternalError type.

INVALID_ARGUMENT

firebase_admin.exceptions.INVALID_ARGUMENT='INVALID_ARGUMENT'

Error code forInvalidArgumentError type.

NOT_FOUND

firebase_admin.exceptions.NOT_FOUND='NOT_FOUND'

Error code forNotFoundError type.

OUT_OF_RANGE

firebase_admin.exceptions.OUT_OF_RANGE='OUT_OF_RANGE'

Error code forOutOfRangeError type.

PERMISSION_DENIED

firebase_admin.exceptions.PERMISSION_DENIED='PERMISSION_DENIED'

Error code forPermissionDeniedError type.

RESOURCE_EXHAUSTED

firebase_admin.exceptions.RESOURCE_EXHAUSTED='RESOURCE_EXHAUSTED'

Error code forResourceExhaustedError type.

UNAUTHENTICATED

firebase_admin.exceptions.UNAUTHENTICATED='UNAUTHENTICATED'

Error code forUnauthenticatedError type.

UNAVAILABLE

firebase_admin.exceptions.UNAVAILABLE='UNAVAILABLE'

Error code forUnavailableError type.

UNKNOWN

firebase_admin.exceptions.UNKNOWN='UNKNOWN'

Error code forUnknownError type.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-03-12 UTC.