From fc95b26c45924cf9e55af2739dbc90d5b90925ce Mon Sep 17 00:00:00 2001 From: Philip Trauner Date: Sat, 22 Apr 2017 19:56:04 +0200 Subject: [PATCH] Handle playback failure --- Wallaby/Wallaby.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Wallaby/Wallaby.py b/Wallaby/Wallaby.py index 50404bd..ca28e9c 100644 --- a/Wallaby/Wallaby.py +++ b/Wallaby/Wallaby.py @@ -151,7 +151,10 @@ class SensorReadout: class Identify(Pipe): def run(self, data, peer, handler): - Utils.play_sound(config.identify_sound) + try: + Utils.play_sound(config.identify_sound) + except Utils.PlaybackFailure: + Logging.error("Could not play identification sound") Logging.success("I was identified!") @@ -354,4 +357,4 @@ try: ws.connect() ws.run_forever() except KeyboardInterrupt: - ws.close() \ No newline at end of file + ws.close()