diff --git a/src/window/osd/components/audio.py b/src/window/osd/components/audio.py index 049ac12..1ead260 100644 --- a/src/window/osd/components/audio.py +++ b/src/window/osd/components/audio.py @@ -1,3 +1,4 @@ +from fabric.utils import logger import math from fabric.audio import Audio from utils.utils import svg_file @@ -105,6 +106,6 @@ class AudioOSDContainer(BaseOSDContainer): self.audio.disconnect_by_func(self._on_speaker_changed) if self.audio.speaker: self.audio.speaker.disconnect_by_func(self._on_speaker_stream_changed) - except Exception: - pass + except Exception as e: + logger.error(f"An error occurred: {e}") super().destroy() diff --git a/src/window/osd/components/base.py b/src/window/osd/components/base.py index 20034eb..190556d 100644 --- a/src/window/osd/components/base.py +++ b/src/window/osd/components/base.py @@ -1,5 +1,5 @@ from abc import abstractmethod -from fabric.utils import Gdk, GLib, invoke_repeater, remove_handler, time +from fabric.utils import Gdk, GLib, invoke_repeater, remove_handler, time, logger from fabric.widgets.box import Box from fabric.widgets.wayland import WaylandWindow as Window @@ -48,16 +48,16 @@ class BaseOSDContainer(Box): if self.last_handler: try: remove_handler(self.last_handler) - except Exception: - pass + except Exception as e: + logger.error(f"An error occurred: {e}") self.last_handler = 0 def remove_watchdog_handler(self): if self.watchdog_handler: try: GLib.source_remove(self.watchdog_handler) - except Exception: - pass + except Exception as e: + logger.error(f"An error occurred: {e}") self.watchdog_handler = 0 def cleanup_all_handlers(self): diff --git a/src/window/osd/components/brightness.py b/src/window/osd/components/brightness.py index ea3c53d..07ec57e 100644 --- a/src/window/osd/components/brightness.py +++ b/src/window/osd/components/brightness.py @@ -1,3 +1,4 @@ +from fabric.utils import logger import math from services.brightness import Brightness from utils.utils import svg_file @@ -64,6 +65,6 @@ class BrightnessOSDContainer(BaseOSDContainer): self.brightness_service.disconnect_by_func( self._on_screen_brightness_changed ) - except Exception: - pass + except Exception as e: + logger.error(f"An error occurred: {e}") super().destroy() diff --git a/src/window/osd/components/capslock.py b/src/window/osd/components/capslock.py index febea10..8e38113 100644 --- a/src/window/osd/components/capslock.py +++ b/src/window/osd/components/capslock.py @@ -1,3 +1,4 @@ +from fabric.utils import logger from fabric.widgets.label import Label from utils.utils import svg_file from .base import BaseOSDContainer @@ -50,6 +51,6 @@ class CapsLockOSDContainer(BaseOSDContainer): """Disconnect signals from CapsLock service""" try: self.capslock.disconnect_by_func(self._on_caps_lock_state_changed) - except Exception: - pass + except Exception as e: + logger.error(f"An error occurred: {e}") super().destroy() diff --git a/src/window/osd/components/keyboard_layout.py b/src/window/osd/components/keyboard_layout.py index b4f9b8e..0c2ec7a 100644 --- a/src/window/osd/components/keyboard_layout.py +++ b/src/window/osd/components/keyboard_layout.py @@ -1,3 +1,4 @@ +from fabric.utils import logger from fabric.widgets.label import Label from utils.utils import svg_file from .base import BaseOSDContainer @@ -42,6 +43,6 @@ class KeyboardLayoutOSDContainer(BaseOSDContainer): """Disconnect signals from KeyboardLayout service""" try: self.keyboard_layout.disconnect_by_func(self._on_layout_changed) - except Exception: - pass + except Exception as e: + logger.error(f"An error occurred: {e}") super().destroy() diff --git a/src/window/osd/components/microphone.py b/src/window/osd/components/microphone.py index 461d6d9..df02091 100644 --- a/src/window/osd/components/microphone.py +++ b/src/window/osd/components/microphone.py @@ -1,3 +1,4 @@ +from fabric.utils import logger import math from fabric.audio import Audio from utils.utils import svg_file @@ -107,6 +108,6 @@ class MicrophoneOSDContainer(BaseOSDContainer): self.audio.microphone.disconnect_by_func( self._on_microphone_stream_changed ) - except Exception: - pass + except Exception as e: + logger.error(f"An error occurred: {e}") super().destroy()