You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ntool-biz/core/nstatus/util.go

13 lines
263 B
Go

package nstatus
// ConvertErr is a convenience function which removes the need to handle the
// boolean return value from FromError.
func ConvertErr(err error) *Result {
s, ok := FromError(err)
if !ok {
// 尝试grpc
return WrapGrpcErr(err)
}
return s
}