From c791ba76e9ef17977718ab6dcad891c3b5abe8ba Mon Sep 17 00:00:00 2001 From: edo-neo Date: Wed, 6 Nov 2024 12:55:05 +0100 Subject: [PATCH] IMPROVED ERROR FOR USB CONNECTIONS TECNA --- src/components/modbus_component.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/modbus_component.py b/src/components/modbus_component.py index 6bf920b..a4cbe35 100644 --- a/src/components/modbus_component.py +++ b/src/components/modbus_component.py @@ -51,11 +51,11 @@ class ModbusComponent(Component): strict=False, ) if not self.client.connect(): - QMessageBox.critical(None, "ERRORE", "CONNESSIONE ASSENTE ALLA TECNA - VERIFICARE CONNESSIONE USB",) - raise ConnectionError("device not reachable (could not connect): {} ({})".format(self.name, self.port)) + QMessageBox.critical(None, "ERRORE", f"ERRORE TECNA - VERIFICARE CONNESSIONE USB") + exit(-1) + #raise ConnectionError("device not reachable (could not connect): {} ({})".format(self.name, self.port)) if not self.client.is_socket_open(): - QMessageBox.critical(None, "ERRORE", "CONNESSIONE ASSENTE ALLA TECNA - VERIFICARE CONNESSIONE USB",) raise ConnectionError("device not reachable (socket not open): {} ({})".format(self.name, self.port)) self.lock.unlock()