Skip to content

Commit

Permalink
Merge pull request #1 from gogo/rename-error-function
Browse files Browse the repository at this point in the history
Rename StatusError function to GRPCStatus.
  • Loading branch information
johanbrandhorst authored Mar 29, 2018
2 parents dc20428 + 41d6f53 commit 76307dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions status.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (se *statusError) Error() string {
}

// Status converts the gogo/statusError to a grpc/status.
func (se *statusError) Status() *status.Status {
func (se *statusError) GRPCStatus() *status.Status {
p := (*rpc.Status)(se)
s := &spb.Status{
Code: p.GetCode(),
Expand Down Expand Up @@ -138,8 +138,8 @@ func FromError(err error) (s *Status, ok bool) {
if err == nil {
return &Status{s: &rpc.Status{Code: int32(codes.OK)}}, true
}
if se, ok := err.(interface{ Status() *status.Status }); ok {
return FromGRPCStatus(se.Status()), true
if se, ok := err.(interface{ GRPCStatus() *status.Status }); ok {
return FromGRPCStatus(se.GRPCStatus()), true
}
return New(codes.Unknown, err.Error()), false
}
Expand Down

0 comments on commit 76307dd

Please sign in to comment.