error handling in rotation
Build and Publish / test (push) Failing after 1m36s
Build and Publish / build (push) Skipped
Build and Publish / Build and Deploy Docs (push) Skipped

This commit is contained in:
appleb_m
2026-06-10 11:40:05 +02:00
parent fa148c13d8
commit c913db87e5
+11 -6
View File
@@ -1372,7 +1372,7 @@ class AareDAQ:
event_type=SampleEventType.COLLECTIONFAILED,
additional_comment=f"JFJoch communication error: {e}"
)
return None
raise
except Exception as e:
logger.error(f"Rotation sequence failed: {e}")
self._handle_operation_error(
@@ -1381,7 +1381,7 @@ class AareDAQ:
error=e,
event_type=SampleEventType.COLLECTIONFAILED
)
return None
raise
def _append_smargon_trace(self, *, sample_id: int | None, event: str) -> None:
try:
@@ -2075,14 +2075,19 @@ class AareDAQ:
result = self._execute_rotation_sequence(request)
if result is None:
logger.error("Rotation scan failed, no result returned")
raise DataCollectionException("Rotation scan failed, no result returned")
self.__set_state(BeamlineStateEnum.SampleAlignment)
self.__cfg.state_busy = False
return result
except Exception as e:
self.__set_state(BeamlineStateEnum.SampleAlignment)
self.__cfg.state_busy = False
raise
finally:
try:
if self.__cfg.state_busy and self.__cfg.state != BeamlineStateEnum.Maintenance:
self.__set_state(BeamlineStateEnum.SampleAlignment)
except Exception as cleanup_error:
logger.exception(f"Failed to restore SampleAlignment after rotation: {cleanup_error}")
finally:
self.__cfg.state_busy = False
@property
def dtz(self) -> float: