fix: make _safe_sample safer

This commit is contained in:
David Perl
2026-09-17 13:26:19 +02:00
parent 0ad001d71e
commit 93656f46f0
+9 -7
View File
@@ -979,7 +979,10 @@ class AareDAQ:
},
)
logger.warning("cleaning up detector state after failed operation...")
self._jfjoch.cancel(wait_for_done=True)
try:
self._jfjoch.cancel()
except JFJochCommunicationError as e:
logger.error(f"Failure sending cancellation to jfjoch: {e}")
if sample is None or sample_id is None:
logger.error(f"Error in {operation.value}: {error}")
@@ -3093,14 +3096,13 @@ class AareDAQ:
"""
Return (sample, tell_connected, tell_error) without raising.
"""
sample = self._cfg.current_sample
try:
return self.sync_current_sample_from_tell(), True, None
self._devs.tell.get_state()
tell_connected, tell_error = True, None
except TellCommunicationError as e:
return self._cfg.current_sample, False, str(e)
except Exception as e:
logger.warning(f"error in status sample info call: {e}", exc_info=True)
# Keep status flowing even if Tell code throws something unexpected
return self._cfg.current_sample, False, f"TELL unavailable: {e}"
tell_connected, tell_error = False, f"TELL unavailable: {e}"
return sample, tell_connected, tell_error
def _aerotech_status(self) -> tuple[bool, str | None]:
aerotech_ok = True