From f4698446d973d4a3af5fca84b6d472892e09f7db Mon Sep 17 00:00:00 2001 From: anonymous Date: Fri, 20 Dec 2019 13:06:53 +0000 Subject: [PATCH] add error handling in api thread --- button.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/button.py b/button.py index c08d3f9..f5a8838 100644 --- a/button.py +++ b/button.py @@ -135,7 +135,11 @@ class APILoader: def run(self): while True: - self.loadData() + try: + self.loadData() + except Exception as e: + print("Unable to load API data:", e) + time.sleep(self.delay) def loadData(self):