From 526c532bba1b692b6fa31ea7bf785935d6d4f468 Mon Sep 17 00:00:00 2001 From: Felix Hao Date: Thu, 17 Oct 2019 15:59:58 +0800 Subject: [PATCH] fix code message when grpc server return status whitout message (#386) --- pkg/ecode/status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ecode/status.go b/pkg/ecode/status.go index e3eb4bc3c..8268f26ef 100644 --- a/pkg/ecode/status.go +++ b/pkg/ecode/status.go @@ -88,7 +88,7 @@ func FromCode(code Code) *Status { // FromProto new status from grpc detail func FromProto(pbMsg proto.Message) Codes { if msg, ok := pbMsg.(*types.Status); ok { - if msg.Message == "" { + if msg.Message == "" || msg.Message == strconv.FormatInt(int64(msg.Code), 10) { // NOTE: if message is empty convert to pure Code, will get message from config center. return Code(msg.Code) }