From 3590a1cd6752f25fbed0f13ecd2fde7a9e8367f3 Mon Sep 17 00:00:00 2001
From: David Trattnig <david.trattnig@o94.at>
Date: Wed, 6 May 2020 10:59:05 +0200
Subject: [PATCH] Exception handling for Monitoring.

---
 modules/core/monitor.py | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/modules/core/monitor.py b/modules/core/monitor.py
index f2bc75a4..bef74487 100644
--- a/modules/core/monitor.py
+++ b/modules/core/monitor.py
@@ -78,13 +78,16 @@ class Monitoring:
         """
         Checks if the current status is valid to run engine
         """
-        if self.status["soundsystem"]["mixer"]["in_filesystem_0"] \
-            and self.status["redis_ready"] \
-            and self.status["audio_store"]["exists"]:
-
-            return True
-        return False
+        try:
+            if self.status["soundsystem"]["mixer"]["in_filesystem_0"] \
+                and self.status["redis_ready"] \
+                and self.status["audio_store"]["exists"]:
 
+                return True
+            return False
+        except Exception as e:
+            self.logger.error("Exception while validating engine status: " + str(e))
+            return False
 
 
     def validate_url_connection(self, url):
-- 
GitLab