blob: 57fe538e8153a7762d77ba4d3c63764659dd37da [file] [log] [blame]
Jan Tattermuscha7fff862015-02-13 11:08:08 -08001#region Copyright notice and license
2
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003// Copyright 2015 gRPC authors.
Craig Tiller190d3602015-02-18 09:23:38 -08004//
Jan Tattermusch7897ae92017-06-07 22:57:36 +02005// 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
Craig Tiller190d3602015-02-18 09:23:38 -08008//
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009// http://www.apache.org/licenses/LICENSE-2.0
Craig Tiller190d3602015-02-18 09:23:38 -080010//
Jan Tattermusch7897ae92017-06-07 22:57:36 +020011// 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.
Jan Tattermuscha7fff862015-02-13 11:08:08 -080016
17#endregion
18
Jan Tattermusch30868622015-02-19 09:22:33 -080019namespace Grpc.Core
Jan Tattermuscha7608b02015-02-03 17:54:38 -080020{
Jan Tattermuscha7608b02015-02-03 17:54:38 -080021 /// <summary>
Jan Tattermusch286975f2015-03-12 14:04:36 -070022 /// Result of a remote procedure call.
23 /// Based on grpc_status_code from grpc/status.h
Jan Tattermuscha7608b02015-02-03 17:54:38 -080024 /// </summary>
25 public enum StatusCode
26 {
Jan Tattermusch66eb18d2015-08-09 20:03:24 -070027 /// <summary>Not an error; returned on success.</summary>
Jan Tattermusch30868622015-02-19 09:22:33 -080028 OK = 0,
Jan Tattermusch66eb18d2015-08-09 20:03:24 -070029
30 /// <summary>The operation was cancelled (typically by the caller).</summary>
Jan Tattermusch30868622015-02-19 09:22:33 -080031 Cancelled = 1,
Jan Tattermusch66eb18d2015-08-09 20:03:24 -070032
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>
Jan Tattermusch30868622015-02-19 09:22:33 -080040 Unknown = 2,
Jan Tattermusch66eb18d2015-08-09 20:03:24 -070041
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>
Jan Tattermusch30868622015-02-19 09:22:33 -080048 InvalidArgument = 3,
Jan Tattermusch66eb18d2015-08-09 20:03:24 -070049
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>
Jan Tattermusch30868622015-02-19 09:22:33 -080057 DeadlineExceeded = 4,
Jan Tattermusch66eb18d2015-08-09 20:03:24 -070058
59 /// <summary>Some requested entity (e.g., file or directory) was not found.</summary>
Jan Tattermusch30868622015-02-19 09:22:33 -080060 NotFound = 5,
Jan Tattermusch66eb18d2015-08-09 20:03:24 -070061
62 /// <summary>Some entity that we attempted to create (e.g., file or directory) already exists.</summary>
Jan Tattermusch30868622015-02-19 09:22:33 -080063 AlreadyExists = 6,
Jan Tattermusch66eb18d2015-08-09 20:03:24 -070064
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>
Jan Tattermusch30868622015-02-19 09:22:33 -080073 PermissionDenied = 7,
Jan Tattermusch66eb18d2015-08-09 20:03:24 -070074
75 /// <summary>The request does not have valid authentication credentials for the operation.</summary>
Jan Tattermusch30868622015-02-19 09:22:33 -080076 Unauthenticated = 16,
Jan Tattermusch66eb18d2015-08-09 20:03:24 -070077
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>
Jan Tattermusch30868622015-02-19 09:22:33 -080082 ResourceExhausted = 8,
Jan Tattermuscha7608b02015-02-03 17:54:38 -080083
Jan Tattermusch66eb18d2015-08-09 20:03:24 -070084 /// <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>
Jan Tattermusch30868622015-02-19 09:22:33 -080090 FailedPrecondition = 9,
Jan Tattermuscha7608b02015-02-03 17:54:38 -080091
Jan Tattermusch66eb18d2015-08-09 20:03:24 -070092 /// <summary>
93 /// The operation was aborted, typically due to a concurrency issue
94 /// like sequencer check failures, transaction aborts, etc.
95 /// </summary>
Jan Tattermusch30868622015-02-19 09:22:33 -080096 Aborted = 10,
Jan Tattermuscha7608b02015-02-03 17:54:38 -080097
Jan Tattermusch66eb18d2015-08-09 20:03:24 -070098 /// <summary>
99 /// Operation was attempted past the valid range. E.g., seeking or
100 /// reading past end of file.
101 /// </summary>
Jan Tattermusch30868622015-02-19 09:22:33 -0800102 OutOfRange = 11,
Jan Tattermuscha7608b02015-02-03 17:54:38 -0800103
Jan Tattermusch66eb18d2015-08-09 20:03:24 -0700104 /// <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.
118 /// </summary>
Jan Tattermusch30868622015-02-19 09:22:33 -0800119 Unavailable = 14,
Jan Tattermusch66eb18d2015-08-09 20:03:24 -0700120
121 /// <summary>Unrecoverable data loss or corruption.</summary>
Jan Tattermusch30868622015-02-19 09:22:33 -0800122 DataLoss = 15
Jan Tattermuscha7608b02015-02-03 17:54:38 -0800123 }
124}