chickenlj commented on code in PR #2314:
URL: https://github.com/apache/dubbo-go/pull/2314#discussion_r1194737271


##########
remoting/zookeeper/listener.go:
##########
@@ -344,8 +344,7 @@ func (l *ZkEventListener) listenDirEvent(conf *common.URL, 
zkRootPath string, li
                                failTimes = MaxFailTimes
                        }
 
-                       err = perrors.Cause(err)
-                       if !strings.Contains(err.Error(), "node does not 
exist") { // ignore if node not exist
+                       if !perrors.Is(err, zk.ErrNoNode) { // ignore if node 
not exist

Review Comment:
   实际上,上面的字符串关键字 `node does not exist` 也是从 `ErrNoNode` 定义中取的,因此两者能检查的范围应该是一致的。
   
   `ErrNoNode                  = errors.New("zk: node does not exist")` 
   
   perrors.Is 文档说是会嵌套往下检查,理论上与应该没啥问题。
   



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