XnLemon commented on code in PR #3395:
URL: https://github.com/apache/dubbo-go/pull/3395#discussion_r3400053131
##########
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)
if invoker == nil { // can't connect instance
- return nil, perrors.New("can not connect to remote metadata
service host: " + url.Ip)
+ return nil, perrors.New("[Metadata-RPC] can not connect to
remote metadata service host: " + url.Ip)
Review Comment:
好的
--
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]