SwarmConn: don't catch exceptions in handler
This commit is contained in:
parent
5da102d1c9
commit
d483982acb
|
@ -20,7 +20,6 @@ class SwarmConn(INetConn):
|
||||||
muxed_conn: IMuxedConn
|
muxed_conn: IMuxedConn
|
||||||
swarm: "Swarm"
|
swarm: "Swarm"
|
||||||
streams: Set[NetStream]
|
streams: Set[NetStream]
|
||||||
event_started: trio.Event
|
|
||||||
event_closed: trio.Event
|
event_closed: trio.Event
|
||||||
|
|
||||||
def __init__(self, muxed_conn: IMuxedConn, swarm: "Swarm") -> None:
|
def __init__(self, muxed_conn: IMuxedConn, swarm: "Swarm") -> None:
|
||||||
|
@ -72,10 +71,7 @@ class SwarmConn(INetConn):
|
||||||
if self.swarm.common_stream_handler is not None:
|
if self.swarm.common_stream_handler is not None:
|
||||||
try:
|
try:
|
||||||
await self.swarm.common_stream_handler(net_stream)
|
await self.swarm.common_stream_handler(net_stream)
|
||||||
# TODO: More exact exceptions
|
finally:
|
||||||
except Exception:
|
|
||||||
# TODO: Emit logs.
|
|
||||||
# TODO: Clean up and remove the stream from SwarmConn if there is anything wrong.
|
|
||||||
self.remove_stream(net_stream)
|
self.remove_stream(net_stream)
|
||||||
|
|
||||||
def _add_stream(self, muxed_stream: IMuxedStream) -> NetStream:
|
def _add_stream(self, muxed_stream: IMuxedStream) -> NetStream:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user