From 903b9e4ab5557a449572d8178940706c1d6a1959 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Sat, 10 Oct 2020 22:49:13 +0200 Subject: [PATCH] small change to global exception handler make sure all exceptions are logged properly --- music_assistant/mass.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/music_assistant/mass.py b/music_assistant/mass.py index a48d0e08..3b290dcc 100644 --- a/music_assistant/mass.py +++ b/music_assistant/mass.py @@ -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.""" -- 2.34.1