forked from TrueCloudLab/frostfs-node
[#1509] morph: Log WS client closing error
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
1708cc0cc7
commit
8c77387982
1 changed files with 10 additions and 1 deletions
|
@ -112,7 +112,16 @@ func (c *Client) notificationLoop() {
|
|||
// state: if it is closed, the connection is
|
||||
// considered to be lost
|
||||
if !ok {
|
||||
c.logger.Warn("switching to the next RPC node")
|
||||
var closeReason string
|
||||
if closeErr := c.client.GetError(); closeErr != nil {
|
||||
closeReason = closeErr.Error()
|
||||
} else {
|
||||
closeReason = "unknown"
|
||||
}
|
||||
|
||||
c.logger.Warn("switching to the next RPC node",
|
||||
zap.String("reason", closeReason),
|
||||
)
|
||||
|
||||
if !c.switchRPC() {
|
||||
c.logger.Error("could not establish connection to any RPC node")
|
||||
|
|
Loading…
Reference in a new issue