Skip to content

Commit 0923cb9

Browse files
raise error if not optional
1 parent 899d106 commit 0923cb9

File tree

1 file changed

+3
-1
lines changed
  • libra_toolbox/neutron_detection/activation_foils

1 file changed

+3
-1
lines changed

libra_toolbox/neutron_detection/activation_foils/compass.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,13 @@ def from_directory(
247247
start_time, stop_time = get_start_stop_time(source_dir)
248248
measurement_object.start_time = start_time
249249
measurement_object.stop_time = stop_time
250-
except FileNotFoundError:
250+
except FileNotFoundError as e:
251251
if info_file_optional:
252252
warnings.warn(
253253
"run.info file not found. Assuming start and stop time are not needed."
254254
)
255+
else:
256+
raise FileNotFoundError(e)
255257

256258
# Create detectors
257259
detectors = [Detector(channel_nb=nb) for nb in time_values.keys()]

0 commit comments

Comments
 (0)