rename rpcx to zrpc
This commit is contained in:
15
zrpc/internal/codes/accept.go
Normal file
15
zrpc/internal/codes/accept.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package codes
|
||||
|
||||
import (
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
func Acceptable(err error) bool {
|
||||
switch status.Code(err) {
|
||||
case codes.DeadlineExceeded, codes.Internal, codes.Unavailable, codes.DataLoss:
|
||||
return false
|
||||
default:
|
||||
return true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user