-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathstatus_code.dart
More file actions
61 lines (53 loc) · 1.47 KB
/
status_code.dart
File metadata and controls
61 lines (53 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/// Status codes for Firestore operations.
///
/// These codes are used to indicate the result of Firestore operations and
/// correspond to standard gRPC status codes.
enum StatusCode {
ok(0),
cancelled(1),
unknown(2),
invalidArgument(3),
deadlineExceeded(4),
notFound(5),
alreadyExists(6),
permissionDenied(7),
resourceExhausted(8),
failedPrecondition(9),
aborted(10),
outOfRange(11),
unimplemented(12),
internal(13),
unavailable(14),
dataLoss(15),
unauthenticated(16);
const StatusCode(this.value);
static const nonIdempotentRetryCodes = <StatusCode>[];
static const idempotentRetryCodes = <StatusCode>[
StatusCode.deadlineExceeded,
StatusCode.unavailable,
];
static const deadlineExceededResourceExhaustedInternalUnavailable =
<StatusCode>[
StatusCode.deadlineExceeded,
StatusCode.resourceExhausted,
StatusCode.internal,
StatusCode.unavailable,
];
static const resourceExhaustedUnavailable = <StatusCode>[
StatusCode.resourceExhausted,
StatusCode.unavailable,
];
static const resourceExhaustedAbortedUnavailable = <StatusCode>[
StatusCode.resourceExhausted,
StatusCode.aborted,
StatusCode.unavailable,
];
static const commitRetryCodes = resourceExhaustedUnavailable;
static const batchGetRetryCodes = <StatusCode>[
StatusCode.deadlineExceeded,
StatusCode.resourceExhausted,
StatusCode.internal,
StatusCode.unavailable,
];
final int value;
}