Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
c603a789
Commit
c603a789
authored
Sep 30, 2018
by
zhujiashun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement GrpcStatusToErrorCode
parent
7e4197f7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
1 deletion
+35
-1
grpc.cpp
src/brpc/grpc.cpp
+35
-1
No files found.
src/brpc/grpc.cpp
View file @
c603a789
...
@@ -74,8 +74,42 @@ GrpcStatus ErrorCodeToGrpcStatus(int error_code) {
...
@@ -74,8 +74,42 @@ GrpcStatus ErrorCodeToGrpcStatus(int error_code) {
}
}
int
GrpcStatusToErrorCode
(
GrpcStatus
grpc_status
)
{
int
GrpcStatusToErrorCode
(
GrpcStatus
grpc_status
)
{
//TODO(zhujiashun)
switch
(
grpc_status
)
{
case
GRPC_OK
:
return
0
;
case
GRPC_CANCELED
:
return
ECANCELED
;
case
GRPC_UNKNOWN
:
case
GRPC_INVALIDARGUMENT
:
return
EINVAL
;
case
GRPC_DEADLINEEXCEEDED
:
return
ERPCTIMEDOUT
;
case
GRPC_NOTFOUND
:
return
EINTERNAL
;
case
GRPC_ALREADYEXISTS
:
return
EEXIST
;
case
GRPC_PERMISSIONDENIED
:
return
EPERM
;
case
GRPC_RESOURCEEXHAUSTED
:
return
ELIMIT
;
case
GRPC_FAILEDPRECONDITION
:
case
GPRC_ABORTED
:
case
GRPC_OUTOFRANGE
:
return
EINTERNAL
;
case
GRPC_UNIMPLEMENTED
:
return
ENOMETHOD
;
case
GRPC_INTERNAL
:
return
EINTERNAL
;
case
GRPC_UNAVAILABLE
:
return
EAGAIN
;
case
GRPC_DATALOSS
:
return
EINTERNAL
;
return
EINTERNAL
;
case
GRPC_UNAUTHENTICATED
:
return
ERPCAUTH
;
default
:
return
EINTERNAL
;
}
}
}
void
PercentEncode
(
const
std
::
string
&
str
,
std
::
string
*
str_out
)
{
void
PercentEncode
(
const
std
::
string
&
str
,
std
::
string
*
str_out
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment