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 }