From 1a8455236d7f82644fedd48a7fb3126ef4af9a27 Mon Sep 17 00:00:00 2001 From: thijs snijder <snijder@astron.nl> Date: Fri, 2 Apr 2021 13:24:23 +0200 Subject: [PATCH] added exception to read/write set failure in attribute_wrapper set_comm_client function --- devices/PCC.py | 5 ++++- devices/src/attribute_wrapper.py | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/devices/PCC.py b/devices/PCC.py index f1d471da3..7893073c1 100644 --- a/devices/PCC.py +++ b/devices/PCC.py @@ -130,7 +130,10 @@ class PCC(hardware_device): # map the attributes to the OPC ua comm client for i in self.attr_list(): - i.set_comm_client(self.OPCua_client) + try: + i.set_comm_client(self.OPCua_client) + except: + pass self.OPCua_client.start() diff --git a/devices/src/attribute_wrapper.py b/devices/src/attribute_wrapper.py index daa332006..c1b185038 100644 --- a/devices/src/attribute_wrapper.py +++ b/devices/src/attribute_wrapper.py @@ -138,6 +138,4 @@ class attribute_wrapper(attribute): self.read_function = pass_func self.write_function = pass_func - # raise Exception("Exception while setting comm_client read/write functions. using pass function instead. %s") from e - - + raise Exception("Exception while setting comm_client read/write functions. using pass function instead. %s") from e -- GitLab