From 6f0d2f15e1b84787231fae6735bcc27f9ef55d91 Mon Sep 17 00:00:00 2001
From: stedif <stefano.difrischia@inaf.it>
Date: Tue, 26 Jul 2022 10:53:23 +0200
Subject: [PATCH] L2SS-846: add exception handling in auto-shutdown

---
 .../tangostationcontrol/devices/temperature_manager.py     | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py b/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py
index 139d384cd..777343c80 100644
--- a/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py
+++ b/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py
@@ -160,8 +160,11 @@ class TemperatureManager(lofar_device):
         This function automatically shuts down all hardware devices whenever a temperature alarm is detected
         """
         for dev_name in self.Shutdown_Device_List:
-            proxy = DeviceProxy(dev_name)
-            proxy.disable_hardware()
+            try:
+                proxy = DeviceProxy(dev_name)
+                proxy.disable_hardware()
+            except Exception as e:
+                logger.warning(f"Automatic hardware shutdown of device {dev_name} has failed: {e.args[0]}")
         # TODO(Stefano): Add "STAT/PSOC/1" to the shutdown list and develop its behaviour
         logger.warning(f"Temperature alarm triggered auto shutdown of all hardware devices")      
 
-- 
GitLab