Skip to content

Commit

Permalink
👌 Catch all Exceptions during submission loop
Browse files Browse the repository at this point in the history
Instead of only catching `ValueError`, `TypeError` and `AttributeError`, catch
a generic `Exception` and log the failure is the submission failed for a certain
set of extras.

Although this is generally not considered good practise, catching a generic
`Exception` here makes sense since we're trying to report any kind of failure,
even potentially custom subclasses of `Exception`. Now the `submit_new_batch`
method will no longer break because of one faulty submission.
  • Loading branch information
mbercx committed Dec 20, 2023
1 parent b910171 commit 8dcea88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aiida_submission_controller/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def submit_new_batch(self, dry_run=False, sort=True, verbose=False):
# Actually submit
wc_node = engine.submit(builder)

except (ValueError, TypeError, AttributeError) as exc:
except Exception as exc:
CMDLINE_LOGGER.error(f"Failed to submit work chain for extras <{workchain_extras}>: {exc}")
else:
CMDLINE_LOGGER.report(f"Submitted work chain <{wc_node}> for extras <{workchain_extras}>.")
Expand Down

0 comments on commit 8dcea88

Please sign in to comment.