Skip to content

Commit

Permalink
Teeny-tiny updates in buf curl (bufbuild#1882)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhump authored Mar 5, 2023
1 parent d801df8 commit ad59017
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions private/buf/bufcurl/reflection_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const (
// ReflectProtocolGRPCV1 represents the gRPC server reflection protocol
// defined by the service grpc.reflection.v1.ServerReflection.
ReflectProtocolGRPCV1
// ReflectProtocolGRPCV1 represents the gRPC server reflection protocol
// ReflectProtocolGRPCV1Alpha represents the gRPC server reflection protocol
// defined by the service grpc.reflection.v1alpha.ServerReflection.
ReflectProtocolGRPCV1Alpha
)
Expand Down Expand Up @@ -274,9 +274,7 @@ func (r *reflectionResolver) fileByNameLocked(name string) ([]*descriptorpb.File
func descriptorsInResponse(resp *reflectionv1.ServerReflectionResponse) ([]*descriptorpb.FileDescriptorProto, error) {
switch response := resp.MessageResponse.(type) {
case *reflectionv1.ServerReflectionResponse_ErrorResponse:
// TODO: ideally, this would be a wire error
// see https://github.com/bufbuild/connect-go/issues/420
return nil, connect.NewError(connect.Code(response.ErrorResponse.ErrorCode), errors.New(response.ErrorResponse.ErrorMessage))
return nil, connect.NewWireError(connect.Code(response.ErrorResponse.ErrorCode), errors.New(response.ErrorResponse.ErrorMessage))
case *reflectionv1.ServerReflectionResponse_FileDescriptorResponse:
files := make([]*descriptorpb.FileDescriptorProto, len(response.FileDescriptorResponse.FileDescriptorProto))
for i, data := range response.FileDescriptorResponse.FileDescriptorProto {
Expand Down

0 comments on commit ad59017

Please sign in to comment.