Jan Tattermusch | a7fff86 | 2015-02-13 11:08:08 -0800 | [diff] [blame] | 1 | #region Copyright notice and license |
| 2 | |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 3 | // Copyright 2015 gRPC authors. |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 4 | // |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 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 |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 8 | // |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 9 | // http://www.apache.org/licenses/LICENSE-2.0 |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 10 | // |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 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. |
Jan Tattermusch | a7fff86 | 2015-02-13 11:08:08 -0800 | [diff] [blame] | 16 | |
| 17 | #endregion |
| 18 | |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 19 | namespace Grpc.Core |
Jan Tattermusch | a7608b0 | 2015-02-03 17:54:38 -0800 | [diff] [blame] | 20 | { |
Jan Tattermusch | a7608b0 | 2015-02-03 17:54:38 -0800 | [diff] [blame] | 21 | /// <summary> |
Jan Tattermusch | 286975f | 2015-03-12 14:04:36 -0700 | [diff] [blame] | 22 | /// Result of a remote procedure call. |
| 23 | /// Based on grpc_status_code from grpc/status.h |
Jan Tattermusch | a7608b0 | 2015-02-03 17:54:38 -0800 | [diff] [blame] | 24 | /// </summary> |
| 25 | public enum StatusCode |
| 26 | { |
Jan Tattermusch | 66eb18d | 2015-08-09 20:03:24 -0700 | [diff] [blame] | 27 | /// <summary>Not an error; returned on success.</summary> |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 28 | OK = 0, |
Jan Tattermusch | 66eb18d | 2015-08-09 20:03:24 -0700 | [diff] [blame] | 29 | |
| 30 | /// <summary>The operation was cancelled (typically by the caller).</summary> |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 31 | Cancelled = 1, |
Jan Tattermusch | 66eb18d | 2015-08-09 20:03:24 -0700 | [diff] [blame] | 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> |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 40 | Unknown = 2, |
Jan Tattermusch | 66eb18d | 2015-08-09 20:03:24 -0700 | [diff] [blame] | 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> |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 48 | InvalidArgument = 3, |
Jan Tattermusch | 66eb18d | 2015-08-09 20:03:24 -0700 | [diff] [blame] | 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> |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 57 | DeadlineExceeded = 4, |
Jan Tattermusch | 66eb18d | 2015-08-09 20:03:24 -0700 | [diff] [blame] | 58 | |
| 59 | /// <summary>Some requested entity (e.g., file or directory) was not found.</summary> |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 60 | NotFound = 5, |
Jan Tattermusch | 66eb18d | 2015-08-09 20:03:24 -0700 | [diff] [blame] | 61 | |
| 62 | /// <summary>Some entity that we attempted to create (e.g., file or directory) already exists.</summary> |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 63 | AlreadyExists = 6, |
Jan Tattermusch | 66eb18d | 2015-08-09 20:03:24 -0700 | [diff] [blame] | 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> |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 73 | PermissionDenied = 7, |
Jan Tattermusch | 66eb18d | 2015-08-09 20:03:24 -0700 | [diff] [blame] | 74 | |
| 75 | /// <summary>The request does not have valid authentication credentials for the operation.</summary> |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 76 | Unauthenticated = 16, |
Jan Tattermusch | 66eb18d | 2015-08-09 20:03:24 -0700 | [diff] [blame] | 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> |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 82 | ResourceExhausted = 8, |
Jan Tattermusch | a7608b0 | 2015-02-03 17:54:38 -0800 | [diff] [blame] | 83 | |
Jan Tattermusch | 66eb18d | 2015-08-09 20:03:24 -0700 | [diff] [blame] | 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> |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 90 | FailedPrecondition = 9, |
Jan Tattermusch | a7608b0 | 2015-02-03 17:54:38 -0800 | [diff] [blame] | 91 | |
Jan Tattermusch | 66eb18d | 2015-08-09 20:03:24 -0700 | [diff] [blame] | 92 | /// <summary> |
| 93 | /// The operation was aborted, typically due to a concurrency issue |
| 94 | /// like sequencer check failures, transaction aborts, etc. |
| 95 | /// </summary> |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 96 | Aborted = 10, |
Jan Tattermusch | a7608b0 | 2015-02-03 17:54:38 -0800 | [diff] [blame] | 97 | |
Jan Tattermusch | 66eb18d | 2015-08-09 20:03:24 -0700 | [diff] [blame] | 98 | /// <summary> |
| 99 | /// Operation was attempted past the valid range. E.g., seeking or |
| 100 | /// reading past end of file. |
| 101 | /// </summary> |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 102 | OutOfRange = 11, |
Jan Tattermusch | a7608b0 | 2015-02-03 17:54:38 -0800 | [diff] [blame] | 103 | |
Jan Tattermusch | 66eb18d | 2015-08-09 20:03:24 -0700 | [diff] [blame] | 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. |
| 118 | /// </summary> |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 119 | Unavailable = 14, |
Jan Tattermusch | 66eb18d | 2015-08-09 20:03:24 -0700 | [diff] [blame] | 120 | |
| 121 | /// <summary>Unrecoverable data loss or corruption.</summary> |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 122 | DataLoss = 15 |
Jan Tattermusch | a7608b0 | 2015-02-03 17:54:38 -0800 | [diff] [blame] | 123 | } |
| 124 | } |