From 6fce9e681df02105e5daec7939ff30db78ce2114 Mon Sep 17 00:00:00 2001 From: Thomas Juerges <4-jurges@users.noreply.git.astron.nl> Date: Sat, 4 Apr 2020 01:33:32 +0200 Subject: [PATCH] Correct printing of errors during init_device --- crossechoTangoDev/Crossecho.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crossechoTangoDev/Crossecho.py b/crossechoTangoDev/Crossecho.py index 4b7287eb9..08f18bdfb 100644 --- a/crossechoTangoDev/Crossecho.py +++ b/crossechoTangoDev/Crossecho.py @@ -95,9 +95,9 @@ class Crossecho(Device): self.opc_obj = self.client.get_root_node().get_child(["0:Objects", "{}:StationMetrics".format(idx), "{}:RCU".format(idx)]) - print("Connected to the OPC-UA server %s", self.OPC_Server_Name) - except: - print("Failed to connect to the OPC-UA server %s. Traceback: %s", self.OPC_Server_Name, traceback.format_exc()) + print("Connected to the OPC-UA server %s" % (self.OPC_Server_Name)) + except Exception as e: + print("Failed to connect to the OPC-UA server %s. Traceback: %s" % (self.OPC_Server_Name, traceback.format_exc())) self.delete_device() # PROTECTED REGION END # // Crossecho.init_device -- GitLab