cckellogg commented on a change in pull request #536:
URL: https://github.com/apache/pulsar-client-go/pull/536#discussion_r647585697
##########
File path: pulsar/internal/lookup_service.go
##########
@@ -190,11 +190,23 @@ func (ls *lookupService)
GetPartitionedTopicMetadata(topic string) (*Partitioned
}
ls.log.Debugf("Got topic{%s} partitioned metadata response: %+v",
topic, res)
- if res.Response.PartitionMetadataResponse.Error != nil {
- return nil,
errors.New(res.Response.PartitionMetadataResponse.GetError().String())
+ var partitionedTopicMetadata PartitionedTopicMetadata
+
+ if res.Response.Error != nil {
+ return nil, errors.New(res.Response.GetError().String())
+ }
+
+ if res.Response.PartitionMetadataResponse != nil {
+ if res.Response.PartitionMetadataResponse.Error != nil {
+ return nil,
errors.New(res.Response.PartitionMetadataResponse.GetError().String())
+ }
+
+ partitionedTopicMetadata.Partitions =
int(res.Response.PartitionMetadataResponse.GetPartitions())
+ } else {
+ return nil, fmt.Errorf("get topic{%s} partitioned metadata
failed", topic)
Review comment:
maybe add more context here like `no partitioned metadata for topic{%s}
in lookup response`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]