mirror of https://github.com/status-im/nim-eth.git
Add catch for exception in any of the disconnect handlers
This commit is contained in:
parent
5550179dd1
commit
7fd501136f
|
@ -1170,6 +1170,9 @@ proc disconnect*(peer: Peer, reason: DisconnectionReason, notifyOtherPeer = fals
|
|||
try:
|
||||
if not peer.dispatcher.isNil:
|
||||
await callDisconnectHandlers(peer, reason)
|
||||
except:
|
||||
error "Exception in callDisconnectHandlers()",
|
||||
err = getCurrentExceptionMsg()
|
||||
finally:
|
||||
logDisconnectedPeer peer
|
||||
peer.connectionState = Disconnected
|
||||
|
|
Loading…
Reference in New Issue