Skip to content

Commit

Permalink
Limit snitun error to only log if we are reconnecting (#570)
Browse files Browse the repository at this point in the history
* Limit snitun error to only log if we are reconnecting

* lint

* Remove conditional ", reconnecting"
  • Loading branch information
ludeeus authored Feb 19, 2024
1 parent 1ca7821 commit bbf62a5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions hass_nabucasa/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,9 @@ async def connect(self) -> None:
except asyncio.TimeoutError:
_LOGGER.error("Timeout connecting to snitun server")
except SniTunConnectionError as err:
can_reconnect = self._snitun and not self._reconnect_task
_LOGGER.log(
logging.INFO if can_reconnect else logging.ERROR,
"Connection problem to snitun server%s (%s)",
", reconnecting" if can_reconnect else "",
logging.ERROR if self._reconnect_task is not None else logging.INFO,
"Connection problem to snitun server (%s)",
err,
)
except RemoteBackendError:
Expand Down

0 comments on commit bbf62a5

Please sign in to comment.