Skip to content

Commit

Permalink
fix: use grpcStatusFromError to convert stub error to a grpc err
Browse files Browse the repository at this point in the history
  • Loading branch information
sudorandom committed Nov 9, 2024
1 parent bafbdf3 commit 705ec22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion private/server/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func NewHandler(service protoreflect.ServiceDescriptor, db stubs.StubDatabase, v
if err != nil {
var statusErr *stubs.StatusError
if errors.As(err, &statusErr) {
return status.New(codes.Code(statusErr.Code), statusErr.Error()).Err()
return grpcStatusFromError(statusErr.StubsError).Err()
}
return status.New(codes.Internal, err.Error()).Err()
}
Expand Down

0 comments on commit 705ec22

Please sign in to comment.