From 3bc688b8648cc9f5469d38186d635c640424e1ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=2E=20Santos?= Date: Sat, 22 Jun 2024 16:33:45 -0300 Subject: [PATCH] Handle exceptions in display buffer notification --- xradios/tui/buffers/display.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xradios/tui/buffers/display.py b/xradios/tui/buffers/display.py index 35597b2..7331695 100644 --- a/xradios/tui/buffers/display.py +++ b/xradios/tui/buffers/display.py @@ -42,8 +42,12 @@ def update(self, metadata): song = metadata.get('song') if song: - content = f'\n{name:<30} {homepage}\n\n{song}' - notification(name, message=song, app_name='xradios', timeout=5000) + content = f"\n{name:<30} {homepage}\n\n{song}" + try: + notification(name, message=song, app_name="xradios", timeout=5000) + except Exception: + pass + # TODO: log exception to text file else: content = f'\n{name:<30}\n\n{homepage}'