You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/01/25 16:57:05 UTC

[GitHub] [pulsar-client-go] merlimat commented on a change in pull request #450: Logging what really caused lookup failure

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:
users@infra.apache.org