Skip to content

Commit

Permalink
Improve error logging (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kane610 authored Aug 9, 2023
1 parent 2dacaa5 commit 3e51225
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aiounifi/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ def _raise_on_error(data: dict[str, Any] | None) -> None:
return None

if "meta" in data and data["meta"]["rc"] == "error":
LOGGER.error(data)
raise_error(data["meta"]["msg"])

if "errors" in data:
LOGGER.error(data)
raise_error(data["errors"][0])

0 comments on commit 3e51225

Please sign in to comment.