We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent decb438 commit 5da5b1fCopy full SHA for 5da5b1f
status/status.go
@@ -132,7 +132,7 @@ func FromProto(s *spb.Status) *Status {
132
// Status is returned with codes.Unknown and the original error message.
133
func FromError(err error) (s *Status, ok bool) {
134
if err == nil {
135
- return &Status{s: &spb.Status{Code: int32(codes.OK)}}, true
+ return nil, true
136
}
137
if se, ok := err.(interface {
138
GRPCStatus() *Status
@@ -206,7 +206,7 @@ func Code(err error) codes.Code {
206
func FromContextError(err error) *Status {
207
switch err {
208
case nil:
209
- return New(codes.OK, "")
+ return nil
210
case context.DeadlineExceeded:
211
return New(codes.DeadlineExceeded, err.Error())
212
case context.Canceled:
0 commit comments