Add more exception handling
This commit is contained in:
		| @@ -63,6 +63,8 @@ class Main: | ||||
|             logging.exception("Failed to decode allowed uids json") | ||||
|         except (requests.Timeout, requests.ConnectionError) as e: | ||||
|             logging.exception("Connection timeout/error in sync cards") | ||||
|         except Exception: | ||||
|             logging.exception("Some other exception") | ||||
|         else: | ||||
|             uids = set() | ||||
|             for token in allowed_uids: | ||||
| @@ -92,6 +94,8 @@ class Main: | ||||
|             requests.post(self.api_swipe, data=data, timeout=15) | ||||
|         except (requests.Timeout, requests.ConnectionError) as e: | ||||
|             logging.exception("Connection timeout/error in post swipes") | ||||
|         except Exception: | ||||
|             logging.exception("Some other exception") | ||||
|  | ||||
|     def listen_notification(self): | ||||
|         while 1: | ||||
| @@ -110,7 +114,9 @@ class Main: | ||||
|             except (requests.Timeout, | ||||
|                     requests.ConnectionError) as e: | ||||
|                 logging.debug("notification timeout") | ||||
|                 time.sleep(0.1) | ||||
|             except Exception: | ||||
|                 logging.exception("Some other exception") | ||||
|             time.sleep(0.1) | ||||
|  | ||||
|     def auto_sync_loop(self): | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user