Skip to content

Commit

Permalink
Error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
genericmoniker committed Dec 28, 2023
1 parent d6f0563 commit d8e0f29
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions backend/src/mirror/plugins/air_quality/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ async def _refresh(context: PluginContext) -> None:
except httpx.TransportError as ex:
# https://www.python-httpx.org/exceptions/
context.vote_disconnected(ex)
_logger.exception("Network error getting air quality.")
_logger.exception(
"Network error getting air quality. Retry in %s.",
REFRESH_INTERVAL,
)
except Exception:
_logger.exception("Error getting air quality.")
_logger.exception(
"Error getting air quality. Retry in %s.",
REFRESH_INTERVAL,
)
await asyncio.sleep(REFRESH_INTERVAL.total_seconds())

0 comments on commit d8e0f29

Please sign in to comment.