优化错误提示

This commit is contained in:
GoEdgeLab
2023-06-16 08:17:16 +08:00
parent 9dcaa95e55
commit c55d28f46a

View File

@@ -51,3 +51,19 @@ func IsConnError(err error) bool {
return false
}
// IsUnimplementedError 检查是否为未实现错误
func IsUnimplementedError(err error) bool {
if err == nil {
return false
}
statusErr, ok := status.FromError(err)
if ok {
if statusErr.Code() == codes.Unimplemented {
return true
}
}
return false
}