From ac396cb58ddf76cdb6caa2f86264e6ae1a15bbae Mon Sep 17 00:00:00 2001 From: Kylin_on_Mac Date: Fri, 17 Nov 2023 11:48:42 +0800 Subject: [PATCH] fix:add exception in sound_controller.py --- src/sound_controller.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sound_controller.py b/src/sound_controller.py index f004def..e86d85e 100644 --- a/src/sound_controller.py +++ b/src/sound_controller.py @@ -1,3 +1,5 @@ +import traceback + import pygame from .env import * @@ -28,8 +30,9 @@ class SoundController(): self._fail = pygame.mixer.Sound(path.join(SOUND_PATH, "fail.mp3")) self._lv_up = pygame.mixer.Sound(path.join(SOUND_PATH, "lv_up.mp3")) self._lv_down = pygame.mixer.Sound(path.join(SOUND_PATH, "lv_down.mp3")) - except Exception: + except Exception as e : self._is_sound_on = False + traceback.print_exc() @sound_enabled def play_music(self):