Skip to content

Commit ff9bb5e

Browse files
committed
Add error handling for validation data saving in main function
1 parent 37f0806 commit ff9bb5e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Scripts/helmet.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,13 @@ def main(args):
169169
log.info("Not able to remove file {}.".format(f))
170170
log.info("Removed strategy files in {}".format(dbase_path))
171171
if validation is not None:
172-
validation.to_html(
173-
Path(results_path) / args.scenario_name / 'validation.html')
174-
validation.save_to_file(
175-
Path(results_path) / args.scenario_name / 'validation.pklz')
172+
try:
173+
validation.to_html(
174+
Path(results_path) / args.scenario_name / 'validation.html')
175+
validation.save_to_file(
176+
Path(results_path) / args.scenario_name / 'validation.pklz')
177+
except Exception as e:
178+
log.error("Error saving validation data: {}".format(e))
176179
log.info("Simulation ended.", extra=log_extra)
177180

178181

0 commit comments

Comments
 (0)