Skip to content

Commit

Permalink
Merge pull request #272 from rwxayheee/catch_prepare_err_in_cli
Browse files Browse the repository at this point in the history
Catch prepare errors without interrupting batch processing
  • Loading branch information
rwxayheee authored Dec 9, 2024
2 parents 4554056 + 41ef572 commit a4e45d7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion meeko/cli/mk_prepare_ligand.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,15 @@ def main():
print(error_msg, file=sys.stderr)

else:
molsetups = preparator.prepare(mol, rename_atoms=args.rename_atoms)
try:
molsetups = preparator.prepare(mol, rename_atoms=args.rename_atoms)
except Exception as error_msg:
nr_failures += 1
this_mol_had_failure = True
print(error_msg, file=sys.stderr)
input_mol_with_failure += int(this_mol_had_failure)
continue

if len(molsetups) > 1:
output.is_multimol = True
suffixes = output.get_suffixes(molsetups)
Expand Down

0 comments on commit a4e45d7

Please sign in to comment.