diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 7956b88..4fd3ff5 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -199,7 +199,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): self.tec_client = None self._on_connection_changed(False) - except Exception as e: + except (OSError, TimeoutError) as e: logging.error(f"Failed communicating to {ip}:{port}: {e}") await self.tec_client.disconnect() self._on_connection_changed(False)