diff --git a/src/cal_tools/calcat_interface2.py b/src/cal_tools/calcat_interface2.py
index 406eedaf1a87b44ab88aa29b012556257b9b118b..c35b36deb26b243a774aa6acdd27bb54bb0daf29 100644
--- a/src/cal_tools/calcat_interface2.py
+++ b/src/cal_tools/calcat_interface2.py
@@ -500,8 +500,10 @@ class CalibrationData(Mapping):
         begin_at_strategy="closest",
     ):
         accepted_strategies = ["closest", "prior"]
-        strategy_error_msg = f"Invalid begin_at_strategy. Expected one of {accepted_strategies}"
-        assert begin_at_strategy in accepted_strategies, strategy_error_msg
+        if begin_at_strategy not in accepted_strategies:
+            raise ValueError(
+                "Invalid begin_at_strategy. "
+                f"Expected one of {accepted_strategies}")
 
         if calibrations is None:
             calibrations = set(condition.calibration_types)