Skip to content

Commit a4e45d7

Browse files
authored
Merge pull request #272 from rwxayheee/catch_prepare_err_in_cli
Catch prepare errors without interrupting batch processing
2 parents 4554056 + 41ef572 commit a4e45d7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

meeko/cli/mk_prepare_ligand.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,15 @@ def main():
637637
print(error_msg, file=sys.stderr)
638638

639639
else:
640-
molsetups = preparator.prepare(mol, rename_atoms=args.rename_atoms)
640+
try:
641+
molsetups = preparator.prepare(mol, rename_atoms=args.rename_atoms)
642+
except Exception as error_msg:
643+
nr_failures += 1
644+
this_mol_had_failure = True
645+
print(error_msg, file=sys.stderr)
646+
input_mol_with_failure += int(this_mol_had_failure)
647+
continue
648+
641649
if len(molsetups) > 1:
642650
output.is_multimol = True
643651
suffixes = output.get_suffixes(molsetups)

0 commit comments

Comments
 (0)