fix: give a better error on attempting to run raster with no sample
CI / lint (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped

This commit is contained in:
David Perl
2026-09-16 10:01:38 +02:00
parent 5c600785f4
commit 6b6c364843
+3 -1
View File
@@ -1275,6 +1275,8 @@ class AareDAQ:
Returns:
CompletedRasterGrid result or None if failed
"""
if self.sample is None:
raise RasterScanException("Please load a sample before running a raster scan. If you have manually mounted a sample, create its record in the 'Manual sample' panel.")
try:
logger.info(
"Starting raster sequence",
@@ -2037,7 +2039,7 @@ class AareDAQ:
result = self._execute_raster_sequence(request, auto_center=auto_center)
if result is None:
raise RasterScanException("Raster scan failed")
raise RasterScanException("Raster scan failed for unknown reason.")
self._set_state(BeamlineStateEnum.SampleAlignment)
return result
except Exception: