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