Skip to content

Commit

Permalink
fix: set HTTP errors to DEBUG level when they are going to be retried (
Browse files Browse the repository at this point in the history
  • Loading branch information
luuuis authored Jan 3, 2022
1 parent 7938ea4 commit b3967f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/wibeee/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ async def fetch_with_retries(try_n):
except Exception as exc:
if try_n == retries:
retry_info = f' after {try_n} retries' if retries > 0 else ''
_LOGGER.error('Error getting %s%s: %s: %s', url, retry_info, exc.__class__.__name__, exc, exc_info=True)
_LOGGER.error('Error getting %s%s: %s: %s', url, retry_info, exc.__class__.__name__, exc)
return {}
else:
_LOGGER.warning('Error getting %s, will retry. %s: %s', url, exc.__class__.__name__, exc, exc_info=True)
_LOGGER.debug('Error getting %s, will retry. %s: %s', url, exc.__class__.__name__, exc)
return await fetch_with_retries(try_n + 1)

return await fetch_with_retries(0)

0 comments on commit b3967f7

Please sign in to comment.