From 956cede5935d2ca99cc488a15e3fb524098ae802 Mon Sep 17 00:00:00 2001 From: DJ2LS Date: Sat, 24 Feb 2024 20:34:53 +0100 Subject: [PATCH] try except for schedule manager --- modem/schedule_manager.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modem/schedule_manager.py b/modem/schedule_manager.py index 2bc22adf..f238b911 100644 --- a/modem/schedule_manager.py +++ b/modem/schedule_manager.py @@ -79,10 +79,13 @@ class ScheduleManager: def check_for_queued_messages(self): if not self.state_manager.getARQ(): - if DatabaseManagerMessages(self.event_manager).get_first_queued_message(): - params = DatabaseManagerMessages(self.event_manager).get_first_queued_message() - command = command_message_send.SendMessageCommand(self.config_manager.read(), self.state_manager, self.event_manager, params) - command.transmit(self.modem) - + try: + if first_queued_message := DatabaseManagerMessages( + self.event_manager + ).get_first_queued_message(): + command = command_message_send.SendMessageCommand(self.config_manager.read(), self.state_manager, self.event_manager, first_queued_message) + command.transmit(self.modem) + except Exception as e: + print(e) return