From de5f6f495fab6d64168c0d733d7f63888eab820c Mon Sep 17 00:00:00 2001 From: David Perl Date: Tue, 11 Aug 2026 11:36:46 +0200 Subject: [PATCH] fix: reset connection state if cancel fails --- src/aare/devices/jfjoch.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/aare/devices/jfjoch.py b/src/aare/devices/jfjoch.py index 4a618f8f..f0d2b9c8 100644 --- a/src/aare/devices/jfjoch.py +++ b/src/aare/devices/jfjoch.py @@ -72,7 +72,11 @@ class JFJochWrapper: self._api = jfjoch_client.DefaultApi(self._client) # set before cancel(), which is itself decorated and would otherwise recurse self._connected = True - self.cancel(on_init=True) + try: + self.cancel(on_init=True) + except: + self._connected = False + raise @staticmethod def _extract_status_code(error: Exception) -> int | None: