• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #region Copyright notice and license
2 
3 // Copyright 2015 gRPC authors.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #endregion
18 
19 namespace Grpc.Core
20 {
21     /// <summary>
22     /// Result of a remote procedure call.
23     /// Based on grpc_status_code from grpc/status.h
24     /// </summary>
25     public enum StatusCode
26     {
27         /// <summary>Not an error; returned on success.</summary>
28         OK = 0,
29 
30         /// <summary>The operation was cancelled (typically by the caller).</summary>
31         Cancelled = 1,
32 
33         /// <summary>
34         /// Unknown error.  An example of where this error may be returned is
35         /// if a Status value received from another address space belongs to
36         /// an error-space that is not known in this address space.  Also
37         /// errors raised by APIs that do not return enough error information
38         /// may be converted to this error.
39         /// </summary>
40         Unknown = 2,
41 
42         /// <summary>
43         /// Client specified an invalid argument.  Note that this differs
44         /// from FAILED_PRECONDITION.  INVALID_ARGUMENT indicates arguments
45         /// that are problematic regardless of the state of the system
46         /// (e.g., a malformed file name).
47         /// </summary>
48         InvalidArgument = 3,
49 
50         /// <summary>
51         /// Deadline expired before operation could complete.  For operations
52         /// that change the state of the system, this error may be returned
53         /// even if the operation has completed successfully.  For example, a
54         /// successful response from a server could have been delayed long
55         /// enough for the deadline to expire.
56         /// </summary>
57         DeadlineExceeded = 4,
58 
59         /// <summary>Some requested entity (e.g., file or directory) was not found.</summary>
60         NotFound = 5,
61 
62         /// <summary>Some entity that we attempted to create (e.g., file or directory) already exists.</summary>
63         AlreadyExists = 6,
64 
65         /// <summary>
66         /// The caller does not have permission to execute the specified
67         /// operation.  PERMISSION_DENIED must not be used for rejections
68         /// caused by exhausting some resource (use RESOURCE_EXHAUSTED
69         /// instead for those errors).  PERMISSION_DENIED must not be
70         /// used if the caller can not be identified (use UNAUTHENTICATED
71         /// instead for those errors).
72         /// </summary>
73         PermissionDenied = 7,
74 
75         /// <summary>The request does not have valid authentication credentials for the operation.</summary>
76         Unauthenticated = 16,
77 
78         /// <summary>
79         /// Some resource has been exhausted, perhaps a per-user quota, or
80         /// perhaps the entire file system is out of space.
81         /// </summary>
82         ResourceExhausted = 8,
83 
84         /// <summary>
85         /// Operation was rejected because the system is not in a state
86         /// required for the operation's execution.  For example, directory
87         /// to be deleted may be non-empty, an rmdir operation is applied to
88         /// a non-directory, etc.
89         /// </summary>
90         FailedPrecondition = 9,
91 
92         /// <summary>
93         /// The operation was aborted, typically due to a concurrency issue
94         /// like sequencer check failures, transaction aborts, etc.
95         /// </summary>
96         Aborted = 10,
97 
98         /// <summary>
99         /// Operation was attempted past the valid range.  E.g., seeking or
100         /// reading past end of file.
101         /// </summary>
102         OutOfRange = 11,
103 
104         /// <summary>Operation is not implemented or not supported/enabled in this service.</summary>
105         Unimplemented = 12,
106 
107         /// <summary>
108         /// Internal errors.  Means some invariants expected by underlying
109         /// system has been broken.  If you see one of these errors,
110         /// something is very broken.
111         /// </summary>
112         Internal = 13,
113 
114         /// <summary>
115         /// The service is currently unavailable.  This is a most likely a
116         /// transient condition and may be corrected by retrying with
117         /// a backoff. Note that it is not always safe to retry
118         /// non-idempotent operations.
119         /// </summary>
120         Unavailable = 14,
121 
122         /// <summary>Unrecoverable data loss or corruption.</summary>
123         DataLoss = 15
124     }
125 }
126