From 44b4da1ffeb92f1464e8dd4f3bfbc21efc27d572 Mon Sep 17 00:00:00 2001 From: Michel van de Wetering Date: Thu, 18 Apr 2024 20:25:16 +0200 Subject: [PATCH] Log API errors --- aiohuesyncbox/errors.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aiohuesyncbox/errors.py b/aiohuesyncbox/errors.py index f97766f..d71a9bf 100644 --- a/aiohuesyncbox/errors.py +++ b/aiohuesyncbox/errors.py @@ -1,5 +1,9 @@ """Aiohuesyncbox errors.""" +import logging + +logger = logging.getLogger(__name__) + class AiohuesyncboxException(Exception): """Base error for aiohuesyncbox.""" @@ -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))