merlimat commented on a change in pull request #450:
URL: https://github.com/apache/pulsar-client-go/pull/450#discussion_r563880964



##########
File path: pulsar/internal/lookup_service.go
##########
@@ -140,12 +140,9 @@ func (ls *lookupService) Lookup(topic string) 
(*LookupResult, error) {
                        }, nil
 
                case pb.CommandLookupTopicResponse_Failed:
-                       errorMsg := ""
-                       if lr.Error != nil {
-                               errorMsg = lr.Error.String()
-                       }
-                       ls.log.Warnf("Failed to lookup topic: %s, error msg: 
%s", topic, errorMsg)
-                       return nil, fmt.Errorf("failed to lookup topic: %s", 
errorMsg)
+                       err := fmt.Errorf("failed to lookup topic: %s, error: 
%s, message: %s", topic, lr.GetError(), lr.GetMessage())

Review comment:
       We should preferably use the `WithField("error", lr.getGetError())` 
instead of formatting into a string




----------------------------------------------------------------
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]


Reply via email to