small change to global exception handler
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sat, 10 Oct 2020 20:49:13 +0000 (22:49 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Sat, 10 Oct 2020 20:49:13 +0000 (22:49 +0200)
make sure all exceptions are logged properly

music_assistant/mass.py

index a48d0e08c5c9c8cd4e9ea21a45b962082e562843..3b290dcca223ff951d1cff98b15da281065985e0 100644 (file)
@@ -288,9 +288,10 @@ class MusicAssistant:
         self, loop: asyncio.AbstractEventLoop, context: Dict
     ) -> None:
         """Global exception handler."""
-        LOGGER.error("Caught exception: %s", context)
-        if self._debug:
-            loop.default_exception_handler(context)
+        LOGGER.exception(
+            "Caught exception: %s", context.get("exception", context["message"])
+        )
+        loop.default_exception_handler(context)
 
     async def __async_setup_discovery(self) -> None:
         """Make this Music Assistant instance discoverable on the network."""