Skip to content

Commit

Permalink
Capture ConverterErrors in molecules_from_xyz() (#615)
Browse files Browse the repository at this point in the history
The `set_multiplicity()` function can raise a ConverterError which
should also be captured instead of crashing ARC
  • Loading branch information
alongd committed Mar 26, 2023
2 parents 1e992b0 + 711afa9 commit ba4f5b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arc/species/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ def molecules_from_xyz(xyz: Optional[Union[dict, str]],
logger.warning(f'Could not order atoms for {mol_s1_updated.copy(deep=True).to_smiles()}!')
try:
set_multiplicity(mol_s1_updated, mol_bo.multiplicity, charge, radical_map=mol_bo)
except SpeciesError as e:
except (ConverterError, SpeciesError) as e:
logger.warning(f'Cannot infer 2D graph connectivity, failed to set species multiplicity with the '
f'following error:\n{e}')

Expand Down

0 comments on commit ba4f5b9

Please sign in to comment.