mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-02-10 11:56:59 +00:00
avoid pointless exception raising in dcutr/server
(#1063)
This commit is contained in:
parent
08a48faf41
commit
49a92e5641
@ -19,7 +19,6 @@ import ../../protocol,
|
|||||||
../../../switch,
|
../../../switch,
|
||||||
../../../utils/future
|
../../../utils/future
|
||||||
|
|
||||||
export DcutrError
|
|
||||||
export chronicles
|
export chronicles
|
||||||
|
|
||||||
type Dcutr* = ref object of LPProtocol
|
type Dcutr* = ref object of LPProtocol
|
||||||
@ -65,14 +64,14 @@ proc new*(T: typedesc[Dcutr], switch: Switch, connectTimeout = 15.seconds, maxDi
|
|||||||
except CancelledError as err:
|
except CancelledError as err:
|
||||||
raise err
|
raise err
|
||||||
except AllFuturesFailedError as err:
|
except AllFuturesFailedError as err:
|
||||||
debug "Dcutr receiver could not connect to the remote peer, all connect attempts failed", peerDialableAddrs, msg = err.msg
|
debug "Dcutr receiver could not connect to the remote peer, " &
|
||||||
raise newException(DcutrError, "Dcutr receiver could not connect to the remote peer, all connect attempts failed", err)
|
"all connect attempts failed", peerDialableAddrs, msg = err.msg
|
||||||
except AsyncTimeoutError as err:
|
except AsyncTimeoutError as err:
|
||||||
debug "Dcutr receiver could not connect to the remote peer, all connect attempts timed out", peerDialableAddrs, msg = err.msg
|
debug "Dcutr receiver could not connect to the remote peer, " &
|
||||||
raise newException(DcutrError, "Dcutr receiver could not connect to the remote peer, all connect attempts timed out", err)
|
"all connect attempts timed out", peerDialableAddrs, msg = err.msg
|
||||||
except CatchableError as err:
|
except CatchableError as err:
|
||||||
warn "Unexpected error when Dcutr receiver tried to connect to the remote peer", msg = err.msg
|
warn "Unexpected error when Dcutr receiver tried to connect " &
|
||||||
raise newException(DcutrError, "Unexpected error when Dcutr receiver tried to connect to the remote peer", err)
|
"to the remote peer", msg = err.msg
|
||||||
|
|
||||||
let self = T()
|
let self = T()
|
||||||
self.handler = handleStream
|
self.handler = handleStream
|
||||||
|
Loading…
x
Reference in New Issue
Block a user