Skip to content

Commit

Permalink
ignore the GetConfig error and add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
whalecold committed Nov 1, 2023
1 parent d74d9da commit 85ae4aa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nacos/nacos.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ func (c *client) listenConfig(param vo.ConfigParam, uniqueID int64) {
Type: param.Type,
OnChange: c.onChange,
})
// Performs only local connection and fails only when the input params are invalid
if err != nil {
panic(err)
}
Expand All @@ -270,7 +271,9 @@ func (c *client) RegisterConfigCallback(param vo.ConfigParam,
data, err := c.ncli.GetConfig(param)
// the nacos client has handled the not exist error.
if err != nil {
panic(err)
// If the initial connection fails and the reconnection is successful, the callback handler can also be invoked.
// Ignore the error here and print the error info.
klog.Errorf("get config %v from nacos failed %v", param, err)
}

callback(data, c.parser)
Expand Down

0 comments on commit 85ae4aa

Please sign in to comment.