From ab260fc14d10e4ef850d1d974585e6eaaeacf862 Mon Sep 17 00:00:00 2001 From: Kevin Dinkel <1225857+dinkelk@users.noreply.github.com> Date: Thu, 29 Aug 2024 09:28:03 -0600 Subject: [PATCH] Improve error handling for task watchdog list --- .../task_watchdog/gen/models/task_watchdog_list.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/task_watchdog/gen/models/task_watchdog_list.py b/src/components/task_watchdog/gen/models/task_watchdog_list.py index 5340a8f6..df91b7e7 100644 --- a/src/components/task_watchdog/gen/models/task_watchdog_list.py +++ b/src/components/task_watchdog/gen/models/task_watchdog_list.py @@ -190,8 +190,16 @@ def _resolve_pet_connectors(self): ) # Resolve all pet connector component ids: for pet_info in self.watchdog_list.values(): - pet_info.connector_id = connected_components[pet_info.connector_name] - self.watchdog_list[pet_info.connector_name] = pet_info + try: + pet_info.connector_id = connected_components[pet_info.connector_name] + self.watchdog_list[pet_info.connector_name] = pet_info + except KeyError: + raise ModelException( + "Task_Watchdog Lists specifies connector name: " + + str(pet_info.connector_name) + + " which does not exist in the assembly." + ) + # Sort the watchdog list by index: self.watchdog_list = OrderedDict(