|
15 | 15 | """Firebase Exceptions module.
|
16 | 16 |
|
17 | 17 | This module defines the base types for exceptions and the platform-wide error codes as outlined in
|
18 |
| -https://cloud.google.com/apis/design/errors. |
| 18 | +https://cloud.google.com/apis/deesign/errors. |
| 19 | +
|
| 20 | +:class:`FirebaseError` is the parent class of all exceptions raised by the Admin SDK. It contains |
| 21 | +the ``code``, ``http_response`` and ``cause`` properties common to all Firebase exception types. |
| 22 | +Each exception also carries a message that outlines what went wrong. This can be logged for |
| 23 | +audit or debugging purposes. |
| 24 | +
|
| 25 | +When calling an Admin SDK API, developers may catch the parent ``FirebaseError`` and |
| 26 | +inspect its ``code`` to implement fine-grained error handling. Alternatively, developers may |
| 27 | +catch one or more subtypes of ``FirebaseError``. Under normal conditions, any given API may raise |
| 28 | +only a small subset of the available exception subtypes. However, the SDK also exposes rare error |
| 29 | +conditions like connection timeouts and other I/O errors as instances of ``FirebaseError``. |
| 30 | +Therefore it is always a good idea to have a handler specified for ``FirebaseError``, after all the |
| 31 | +subtype error handlers. |
19 | 32 | """
|
20 | 33 |
|
21 | 34 |
|
| 35 | +#: Error code for ``InvalidArgumentError`` type. |
22 | 36 | INVALID_ARGUMENT = 'INVALID_ARGUMENT'
|
| 37 | + |
| 38 | +#: Error code for ``FailedPreconditionError`` type. |
23 | 39 | FAILED_PRECONDITION = 'FAILED_PRECONDITION'
|
| 40 | + |
| 41 | +#: Error code for ``OutOfRangeError`` type. |
24 | 42 | OUT_OF_RANGE = 'OUT_OF_RANGE'
|
| 43 | + |
| 44 | +#: Error code for ``UnauthenticatedError`` type. |
25 | 45 | UNAUTHENTICATED = 'UNAUTHENTICATED'
|
| 46 | + |
| 47 | +#: Error code for ``PermissionDeniedError`` type. |
26 | 48 | PERMISSION_DENIED = 'PERMISSION_DENIED'
|
| 49 | + |
| 50 | +#: Error code for ``NotFoundError`` type. |
27 | 51 | NOT_FOUND = 'NOT_FOUND'
|
| 52 | + |
| 53 | +#: Error code for ``ConflictError`` type. |
28 | 54 | CONFLICT = 'CONFLICT'
|
| 55 | + |
| 56 | +#: Error code for ``AbortedError`` type. |
29 | 57 | ABORTED = 'ABORTED'
|
| 58 | + |
| 59 | +#: Error code for ``AlreadyExistsError`` type. |
30 | 60 | ALREADY_EXISTS = 'ALREADY_EXISTS'
|
| 61 | + |
| 62 | +#: Error code for ``ResourceExhaustedError`` type. |
31 | 63 | RESOURCE_EXHAUSTED = 'RESOURCE_EXHAUSTED'
|
| 64 | + |
| 65 | +#: Error code for ``CancelledError`` type. |
32 | 66 | CANCELLED = 'CANCELLED'
|
| 67 | + |
| 68 | +#: Error code for ``DataLossError`` type. |
33 | 69 | DATA_LOSS = 'DATA_LOSS'
|
| 70 | + |
| 71 | +#: Error code for ``UnknownError`` type. |
34 | 72 | UNKNOWN = 'UNKNOWN'
|
| 73 | + |
| 74 | +#: Error code for ``InternalError`` type. |
35 | 75 | INTERNAL = 'INTERNAL'
|
| 76 | + |
| 77 | +#: Error code for ``UnavailableError`` type. |
36 | 78 | UNAVAILABLE = 'UNAVAILABLE'
|
| 79 | + |
| 80 | +#: Error code for ``DeadlineExceededError`` type. |
37 | 81 | DEADLINE_EXCEEDED = 'DEADLINE_EXCEEDED'
|
38 | 82 |
|
39 | 83 |
|
|
0 commit comments