From 33c74741fe4ac6a0e55e56a1231231d09120bec3 Mon Sep 17 00:00:00 2001 From: jaknapper Date: Mon, 7 Apr 2025 15:46:20 +0100 Subject: [PATCH] Fixed import and re-raise cancelled error --- .../things/camera_stage_mapping.py | 3 ++- 1 file changed, 2 insertions(+), 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 ab6d4058..a860636f 100644 --- a/src/openflexure_microscope_server/things/camera_stage_mapping.py +++ b/src/openflexure_microscope_server/things/camera_stage_mapping.py @@ -32,7 +32,7 @@ from camera_stage_mapping.camera_stage_calibration_1d import ( calibrate_backlash_1d, image_to_stage_displacement_from_1d, ) -from camera_stage_mapping.exceoptions import MappingError +from camera_stage_mapping.exceptions import MappingError from labthings_fastapi.dependencies.invocation import ( InvocationCancelledError, InvocationLogger, @@ -211,6 +211,7 @@ class CameraStageMapper(Thing): logger.info("User cancelled the camera stage mapping calibration") logger.info("Returning to starting position") stage.move_absolute(**starting_position, block_cancellation=True) + raise e except MappingError as e: logger.info("Returning to starting position due to failed calibration") stage.move_absolute(**starting_position, block_cancellation=True)