buildkit_frontend/error.rs
1/// https://godoc.org/google.golang.org/grpc/codes#Code
2pub enum ErrorCode {
3 /// OK is returned on success.
4 OK = 0,
5
6 /// Canceled indicates the operation was canceled (typically by the caller).
7 Canceled = 1,
8
9 /// Unknown error. An example of where this error may be returned is
10 /// if a Status value received from another address space belongs to
11 /// an error-space that is not known in this address space. Also
12 /// errors raised by APIs that do not return enough error information
13 /// may be converted to this error.
14 Unknown = 2,
15
16 /// InvalidArgument indicates client specified an invalid argument.
17 /// Note that this differs from FailedPrecondition. It indicates arguments
18 /// that are problematic regardless of the state of the system
19 /// (e.g., a malformed file name).
20 InvalidArgument = 3,
21
22 /// DeadlineExceeded means operation expired before completion.
23 /// For operations that change the state of the system, this error may be
24 /// returned even if the operation has completed successfully. For
25 /// example, a successful response from a server could have been delayed
26 /// long enough for the deadline to expire.
27 DeadlineExceeded = 4,
28
29 /// NotFound means some requested entity (e.g., file or directory) was
30 /// not found.
31 NotFound = 5,
32
33 /// AlreadyExists means an attempt to create an entity failed because one
34 /// already exists.
35 AlreadyExists = 6,
36
37 /// PermissionDenied indicates the caller does not have permission to
38 /// execute the specified operation. It must not be used for rejections
39 /// caused by exhausting some resource (use ResourceExhausted
40 /// instead for those errors). It must not be
41 /// used if the caller cannot be identified (use Unauthenticated
42 /// instead for those errors).
43 PermissionDenied = 7,
44
45 /// ResourceExhausted indicates some resource has been exhausted, perhaps
46 /// a per-user quota, or perhaps the entire file system is out of space.
47 ResourceExhausted = 8,
48
49 /// FailedPrecondition indicates operation was rejected because the
50 /// system is not in a state required for the operation's execution.
51 /// For example, directory to be deleted may be non-empty, an rmdir
52 /// operation is applied to a non-directory, etc.
53 ///
54 /// A litmus test that may help a service implementor in deciding
55 /// between FailedPrecondition, Aborted, and Unavailable:
56 /// (a) Use Unavailable if the client can retry just the failing call.
57 /// (b) Use Aborted if the client should retry at a higher-level
58 /// (e.g., restarting a read-modify-write sequence).
59 /// (c) Use FailedPrecondition if the client should not retry until
60 /// the system state has been explicitly fixed. E.g., if an "rmdir"
61 /// fails because the directory is non-empty, FailedPrecondition
62 /// should be returned since the client should not retry unless
63 /// they have first fixed up the directory by deleting files from it.
64 /// (d) Use FailedPrecondition if the client performs conditional
65 /// REST Get/Update/Delete on a resource and the resource on the
66 /// server does not match the condition. E.g., conflicting
67 /// read-modify-write on the same resource.
68 FailedPrecondition = 9,
69
70 /// Aborted indicates the operation was aborted, typically due to a
71 /// concurrency issue like sequencer check failures, transaction aborts,
72 /// etc.
73 ///
74 /// See litmus test above for deciding between FailedPrecondition,
75 /// Aborted, and Unavailable.
76 Aborted = 10,
77
78 /// OutOfRange means operation was attempted past the valid range.
79 /// E.g., seeking or reading past end of file.
80 ///
81 /// Unlike InvalidArgument, this error indicates a problem that may
82 /// be fixed if the system state changes. For example, a 32-bit file
83 /// system will generate InvalidArgument if asked to read at an
84 /// offset that is not in the range [0,2^32-1], but it will generate
85 /// OutOfRange if asked to read from an offset past the current
86 /// file size.
87 ///
88 /// There is a fair bit of overlap between FailedPrecondition and
89 /// OutOfRange. We recommend using OutOfRange (the more specific
90 /// error) when it applies so that callers who are iterating through
91 /// a space can easily look for an OutOfRange error to detect when
92 /// they are done.
93 OutOfRange = 11,
94
95 /// Unimplemented indicates operation is not implemented or not
96 /// supported/enabled in this service.
97 Unimplemented = 12,
98
99 /// Internal errors. Means some invariants expected by underlying
100 /// system has been broken. If you see one of these errors,
101 /// something is very broken.
102 Internal = 13,
103
104 /// Unavailable indicates the service is currently unavailable.
105 /// This is a most likely a transient condition and may be corrected
106 /// by retrying with a backoff. Note that it is not always safe to retry
107 /// non-idempotent operations.
108 ///
109 /// See litmus test above for deciding between FailedPrecondition,
110 /// Aborted, and Unavailable.
111 Unavailable = 14,
112
113 /// DataLoss indicates unrecoverable data loss or corruption.
114 DataLoss = 15,
115
116 /// Unauthenticated indicates the request does not have valid
117 /// authentication credentials for the operation.
118 Unauthenticated = 16,
119}