Skip to content

Commit

Permalink
Exception debug logging in retry attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
WillCodeForCats committed Aug 6, 2023
1 parent 0b66ae2 commit 05d74ee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions custom_components/solaredge_modbus_multi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,14 @@ async def _refresh_modbus_data_with_retry(
try:
async with async_timeout.timeout(self._hub.coordinator_timeout):
return await self._hub.async_refresh_modbus_data()
except Exception as ex:
if not isinstance(ex, ex_type):
raise ex
except Exception as e:
if not isinstance(e, ex_type):
raise e
if 0 < limit <= attempt:
_LOGGER.debug(f"No more data refresh attempts (maximum {limit})")
raise ex
raise e

_LOGGER.debug(f"Failed data refresh attempt #{attempt}")
_LOGGER.debug(f"Failed data refresh attempt #{attempt}: {e}")

attempt += 1
_LOGGER.debug(
Expand Down

0 comments on commit 05d74ee

Please sign in to comment.