Port to trio's new resource error

reg_with_uid
Tyler Goodlet 2018-08-04 17:59:10 -04:00
parent 163f747afb
commit bd14cbe082
1 changed files with 2 additions and 3 deletions

View File

@ -189,8 +189,7 @@ class Actor:
self, self,
stream: trio.SocketStream, stream: trio.SocketStream,
): ):
""" """Entry point for new inbound connections to the channel server.
Entry point for new inbound connections to the channel server.
""" """
self._no_more_peers.clear() self._no_more_peers.clear()
chan = Channel(stream=stream) chan = Channel(stream=stream)
@ -456,7 +455,7 @@ class Actor:
try: try:
await self._parent_chan.send( await self._parent_chan.send(
{'error': traceback.format_exc(), 'cid': 'internal'}) {'error': traceback.format_exc(), 'cid': 'internal'})
except trio.ClosedStreamError: except trio.ClosedResourceError:
log.error( log.error(
f"Failed to ship error to parent " f"Failed to ship error to parent "
f"{self._parent_chan.uid}, channel was closed") f"{self._parent_chan.uid}, channel was closed")