From 415d55f599da4757033c80e1481e7a52ae3af9d2 Mon Sep 17 00:00:00 2001 From: x01dc Date: Sun, 6 Sep 2026 12:25:39 +0200 Subject: [PATCH] fix(omny): widen misleading "position not free"/"no sample available" errors Both _otransfer_check_free_slot_available_at_position() and _otransfer_check_sample_available_at_position() distinguish "slot occupied/empty" from "no shuttle parked at the active parking position" internally (via print()), but only returned bool -- so the raised OMNYTransferError always said "position N is not free"/"no sample available at position N" even when the real cause was no shuttle being parked at oparkz's current slot at all, which reads as if the pin itself were the problem. Widened both messages to cover either cause, per Mirko's simplest-fix suggestion. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_018Mupip8x7Hean6E3FFvpbj --- .../plugins/omny/omny_sample_transfer_mixin.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/csaxs_bec/bec_ipython_client/plugins/omny/omny_sample_transfer_mixin.py b/csaxs_bec/bec_ipython_client/plugins/omny/omny_sample_transfer_mixin.py index e0703aed..4e6bbdd0 100644 --- a/csaxs_bec/bec_ipython_client/plugins/omny/omny_sample_transfer_mixin.py +++ b/csaxs_bec/bec_ipython_client/plugins/omny/omny_sample_transfer_mixin.py @@ -793,7 +793,10 @@ class OMNYSampleTransferMixin: self.transfer_step = 0 self._otransfer_check_sensor_connected() if not self._otransfer_check_free_slot_available_at_position(pin_position, 0): - raise OMNYTransferError(f"position {pin_position} is not free") + raise OMNYTransferError( + f"position {pin_position} is not free, or no shuttle is parked at the" + " active parking position" + ) # global _ogalil_encoder_steps_per_mm if pin_position == 0: @@ -940,7 +943,10 @@ class OMNYSampleTransferMixin: self._otransfer_check_sensor_connected() if not self._otransfer_check_sample_available_at_position(pin_position, 0): - raise OMNYTransferError(f"There is no sample available at position {pin_position}") + raise OMNYTransferError( + f"There is no sample available at position {pin_position}, or no shuttle is" + " parked at the active parking position" + ) # global _otransy_approach_height # global _ogalil_encoder_steps_per_mm