XnLemon commented on code in PR #3395:
URL: https://github.com/apache/dubbo-go/pull/3395#discussion_r3400214831


##########
metadata/client.go:
##########
@@ -45,18 +45,25 @@ const defaultTimeout = "5s" // s
 func GetMetadataFromMetadataReport(revision string, instance 
registry.ServiceInstance, registryId string) (*info.MetadataInfo, error) {
        report := GetMetadataReportByRegistry(registryId)
        if report == nil {
-               return nil, perrors.Errorf("no metadata report instance found 
for registryId=%s, please check metadata-report configuration", registryId)
+               return nil, perrors.Errorf("[Metadata-Report] no metadata 
report instance found for registryId=%s, please check metadata-report 
configuration", registryId)
        }
-       return report.GetAppMetadata(instance.GetServiceName(), revision)
+       meta, err := report.GetAppMetadata(instance.GetServiceName(), revision)
+       if err != nil {
+               return nil, perrors.Wrapf(err, "[Metadata-Report] failed to get 
app metadata app=%s revision=%s", instance.GetServiceName(), revision)
+       }
+       return meta, nil
 }
 
 func GetMetadataFromRpc(revision string, instance registry.ServiceInstance) 
(*info.MetadataInfo, error) {
        url := buildStandardMetadataServiceURL(instance)
+       if url == nil {
+               return nil, perrors.New("[Metadata-URL] metadata service URL 
params missing: protocol is empty")
+       }
        url.SetParam(constant.TimeoutKey, defaultTimeout)
        p := extension.GetProtocol(url.Protocol)
        invoker := p.Refer(url)

Review Comment:
   same with https://github.com/apache/dubbo-go/pull/3395/changes#r3392753362



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to