将RPC Canceled错误级别调整为警告

This commit is contained in:
GoEdgeLab
2022-04-07 09:45:27 +08:00
parent 1f54e03688
commit 60cedd498b

View File

@@ -41,7 +41,8 @@ func IsConnError(err error) bool {
// 检查是否为连接错误 // 检查是否为连接错误
statusErr, ok := status.FromError(err) statusErr, ok := status.FromError(err)
if ok { if ok {
return statusErr.Code() == codes.Unavailable var errorCode = statusErr.Code()
return errorCode == codes.Unavailable || errorCode == codes.Canceled
} }
return false return false