Skip to content
Snippets Groups Projects
Commit c9dc159c authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Override exception handling if specified

parent 4553fde7
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,7 @@ def get_matching_files(where: str, ext: str, coord_filter: dict={}) -> str:
def loop_workflow(files, where_output, workflow_func, params,
write_intermediate_products=True):
write_intermediate_products=True, catch_and_continue=True):
failures = []
for ii, ff in enumerate(files):
export_kwargs = {
......@@ -63,12 +63,15 @@ def loop_workflow(files, where_output, workflow_func, params,
try:
result = workflow_func(**export_kwargs)
except Exception as e:
failures.append({
'input_file': ff,
'error_message': e.__str__(),
})
print(f'Caught failure on {ff}:\n{e.__str__()}')
continue
if catch_and_continue:
failures.append({
'input_file': ff,
'error_message': e.__str__(),
})
print(f'Caught failure on {ff}:\n{e.__str__()}')
continue
else:
raise e
# record dataframes associated with workflow results
batch_csv = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment