From 7572578b8b498c3e6b23aa8450de15bdc291ccb8 Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Fri, 27 Sep 2019 10:04:41 -0700 Subject: [PATCH] Remove usage of deprecated methods. (#4076) ErrorDesc in the grpc is deprecated. It's been replaced by the recommended methods. --- x/x.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x/x.go b/x/x.go index 693639fe627..2d191aeddc2 100644 --- a/x/x.go +++ b/x/x.go @@ -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. @@ -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") ||