From 67443ff939b3dc04ab78bec45cca4744088c4736 Mon Sep 17 00:00:00 2001 From: jaknapper Date: Thu, 3 Apr 2025 13:52:04 +0100 Subject: [PATCH] Capture ValueErrors, which covers most CSM errors, not all Exceptions --- .../things/camera_stage_mapping.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openflexure_microscope_server/things/camera_stage_mapping.py b/src/openflexure_microscope_server/things/camera_stage_mapping.py index 0c3e79b2..bfe3f9cf 100644 --- a/src/openflexure_microscope_server/things/camera_stage_mapping.py +++ b/src/openflexure_microscope_server/things/camera_stage_mapping.py @@ -206,7 +206,7 @@ class CameraStageMapper(Thing): result: dict = calibrate_backlash_1d( tracker, move, direction_array, logger=logger ) - except (InvocationCancelledError, Exception) as e: + except (InvocationCancelledError, ValueError) as e: logger.info("Returning to starting position") stage.move_absolute(**starting_position, block_cancellation=True) raise e