Skip to content

Commit

Permalink
Log API errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdwetering committed Apr 18, 2024
1 parent 6b372e8 commit 44b4da1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aiohuesyncbox/errors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
"""Aiohuesyncbox errors."""

import logging

logger = logging.getLogger(__name__)


class AiohuesyncboxException(Exception):
"""Base error for aiohuesyncbox."""
Expand Down Expand Up @@ -36,4 +40,5 @@ class InvalidState(AiohuesyncboxException):

def raise_error(code: int, message: str) -> None:
cls = ERRORS.get(code, AiohuesyncboxException)
logger.debug("raise_error, %s, %s, %s" % (code, message, cls))
raise cls("{}: {}".format(code, message))

0 comments on commit 44b4da1

Please sign in to comment.