Skip to content

Commit

Permalink
update filenames with "_crash" if reduce catches an Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-simpson committed Mar 6, 2023
1 parent 0b200da commit 9e0e7cf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion recipe_system/reduction/coreReduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,12 @@ def reduce_data(files, mode='sq', drpkg='geminidr', recipename=None, uparms={},
log.error("Reduce received an unhandled exception. Aborting ...")
log_traceback(log)
log.stdinfo("Writing final outputs ...")
_write_final(p.streams['main'], suffix)
try:
for ad in p.streams['main']:
ad.update_filename(suffix="_crash")
except: # in case something has gone really wrong!
log.stdinfo("Problem updating filenames")
_write_final(p.streams['main'], None)
_output_filenames = [ad.filename for ad in p.streams['main']]
raise

Expand Down

0 comments on commit 9e0e7cf

Please sign in to comment.