Alanxtl commented on code in PR #3059:
URL: https://github.com/apache/dubbo-go/pull/3059#discussion_r2447903355
##########
config_center/zookeeper/impl.go:
##########
@@ -134,6 +134,10 @@ func (c *zookeeperDynamicConfiguration) GetProperties(key
string, opts ...config
key = c.GetURL().GetParam(constant.ConfigNamespaceKey,
config_center.DefaultGroup) + "/" + key
}
content, _, err := c.client.GetContent(c.rootPath + "/" + key)
+ if perrors.Is(err, zk.ErrNoNode) {
Review Comment:
is it necessary to use `perrors`? why not just use `errors.Is`
##########
registry/nacos/registry_test.go:
##########
@@ -204,6 +204,18 @@ func (mr *MockINamingClientMockRecorder)
GetAllServicesInfo(param any) *gomock.C
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock,
"GetAllServicesInfo",
reflect.TypeOf((*MockINamingClient)(nil).GetAllServicesInfo), param)
}
+// ServerHealthy mocks base method
+func (m *MockINamingClient) ServerHealthy() bool {
+ ret := m.ctrl.Call(m, "ServerHealthy")
+ ret0, _ := ret[0].(bool)
+ return ret0
+}
+
+// ServerHealthy indicates an expected call of ServerHealthy
+func (mr *MockINamingClientMockRecorder) ServerHealthy() *gomock.Call {
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServerHealthy",
reflect.TypeOf((*MockINamingClient)(nil).ServerHealthy))
+}
Review Comment:
What do these mock functions do? I haven't found where these two functions
are called.
##########
config_center/nacos/impl.go:
##########
@@ -168,7 +168,12 @@ func (n *nacosDynamicConfiguration) GetRule(key string,
opts ...config_center.Op
Group: resolvedGroup,
})
if err != nil {
- return "", perrors.WithStack(err)
+ if strings.Contains(err.Error(), "config data not exist") {
+ logger.Warnf("query rule fail, key=%s, group=%s,
err=%v", key, resolvedGroup, err)
+ return "", nil
Review Comment:
use `errors.Is` or `errors.As` to make judgement on error instead of
`string.contains`
--
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]