Skip to content

Commit

Permalink
Split ping exceptions to differentiate (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Sep 26, 2024
1 parent d1f1352 commit 8771dfd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions snitun/multiplexer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,13 @@ async def ping(self) -> None:
async with async_timeout.timeout(PEER_TCP_TIMEOUT):
await self._healthy.wait()

except (OSError, asyncio.TimeoutError):
_LOGGER.error("Ping fails, no response from peer")
except asyncio.TimeoutError:
_LOGGER.error("Timeout error while pinging peer")
self._loop.call_soon(self.shutdown)
raise MultiplexerTransportError from None

except OSError as exception:
_LOGGER.error("Peer ping failed - %s", exception)
self._loop.call_soon(self.shutdown)
raise MultiplexerTransportError from None

Expand Down

0 comments on commit 8771dfd

Please sign in to comment.