Skip to content

Commit

Permalink
Remove usage of deprecated methods. (#4076)
Browse files Browse the repository at this point in the history
ErrorDesc in the grpc is deprecated. It's been replaced by the
recommended methods.
  • Loading branch information
martinmr committed Sep 27, 2019
1 parent 2823be2 commit 7572578
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion x/x.go
Expand Up @@ -46,6 +46,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/encoding/gzip"
"google.golang.org/grpc/status"
)

// Error constants representing different types of errors.
Expand Down Expand Up @@ -121,7 +122,7 @@ func ShouldCrash(err error) bool {
if err == nil {
return false
}
errStr := grpc.ErrorDesc(err)
errStr := status.Convert(err).Message()
return strings.Contains(errStr, "REUSE_RAFTID") ||
strings.Contains(errStr, "REUSE_ADDR") ||
strings.Contains(errStr, "NO_ADDR") ||
Expand Down

0 comments on commit 7572578

Please sign in to comment.