Skip to content

Commit 8a8ac82

Browse files
thinkerouMakMukhi
authored andcommitted
update const order (grpc#1770)
1 parent e975017 commit 8a8ac82

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

codes/codes.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
// Package codes defines the canonical error codes used by gRPC. It is
2020
// consistent across various languages.
2121
package codes // import "google.golang.org/grpc/codes"
22+
2223
import (
2324
"fmt"
2425
)
@@ -33,9 +34,9 @@ const (
3334
// Canceled indicates the operation was canceled (typically by the caller).
3435
Canceled Code = 1
3536

36-
// Unknown error. An example of where this error may be returned is
37+
// Unknown error. An example of where this error may be returned is
3738
// if a Status value received from another address space belongs to
38-
// an error-space that is not known in this address space. Also
39+
// an error-space that is not known in this address space. Also
3940
// errors raised by APIs that do not return enough error information
4041
// may be converted to this error.
4142
Unknown Code = 2
@@ -64,15 +65,11 @@ const (
6465
// PermissionDenied indicates the caller does not have permission to
6566
// execute the specified operation. It must not be used for rejections
6667
// caused by exhausting some resource (use ResourceExhausted
67-
// instead for those errors). It must not be
68+
// instead for those errors). It must not be
6869
// used if the caller cannot be identified (use Unauthenticated
6970
// instead for those errors).
7071
PermissionDenied Code = 7
7172

72-
// Unauthenticated indicates the request does not have valid
73-
// authentication credentials for the operation.
74-
Unauthenticated Code = 16
75-
7673
// ResourceExhausted indicates some resource has been exhausted, perhaps
7774
// a per-user quota, or perhaps the entire file system is out of space.
7875
ResourceExhausted Code = 8
@@ -88,7 +85,7 @@ const (
8885
// (b) Use Aborted if the client should retry at a higher-level
8986
// (e.g., restarting a read-modify-write sequence).
9087
// (c) Use FailedPrecondition if the client should not retry until
91-
// the system state has been explicitly fixed. E.g., if an "rmdir"
88+
// the system state has been explicitly fixed. E.g., if an "rmdir"
9289
// fails because the directory is non-empty, FailedPrecondition
9390
// should be returned since the client should not retry unless
9491
// they have first fixed up the directory by deleting files from it.
@@ -117,7 +114,7 @@ const (
117114
// file size.
118115
//
119116
// There is a fair bit of overlap between FailedPrecondition and
120-
// OutOfRange. We recommend using OutOfRange (the more specific
117+
// OutOfRange. We recommend using OutOfRange (the more specific
121118
// error) when it applies so that callers who are iterating through
122119
// a space can easily look for an OutOfRange error to detect when
123120
// they are done.
@@ -127,8 +124,8 @@ const (
127124
// supported/enabled in this service.
128125
Unimplemented Code = 12
129126

130-
// Internal errors. Means some invariants expected by underlying
131-
// system has been broken. If you see one of these errors,
127+
// Internal errors. Means some invariants expected by underlying
128+
// system has been broken. If you see one of these errors,
132129
// something is very broken.
133130
Internal Code = 13
134131

@@ -142,6 +139,10 @@ const (
142139

143140
// DataLoss indicates unrecoverable data loss or corruption.
144141
DataLoss Code = 15
142+
143+
// Unauthenticated indicates the request does not have valid
144+
// authentication credentials for the operation.
145+
Unauthenticated Code = 16
145146
)
146147

147148
var strToCode = map[string]Code{

0 commit comments

Comments
 (0)