Skip to content

Commit

Permalink
Better error wrapping.
Browse files Browse the repository at this point in the history
  • Loading branch information
bieniekmateusz committed Aug 20, 2023
1 parent 6b886b7 commit c56571b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ties/ligand.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,9 @@ def generate_frcmod(self, **kwargs):
cwd= cwd, timeout=20, # 20 seconds
)
except subprocess.CalledProcessError as E:
print('ERROR file content: ', open(log_filename).read())
print('ERROR: An error occured during the antechamber conversion from .ac to .mol2 data type. ')
print(f'ERROR: The output was saved in the directory: {cwd}')
print(f'ERROR: Please see the log file for the exact error information: {log_filename}')
raise E
raise Exception(f"Was not able to generate the GAFF forcefield functional forms FRCMOD. "
f'ERROR: Please see the following log file and its directory '
f'for more error information: {log_filename}') from E

print(f'Parmchk2: created .frcmod: {target_frcmod}')
self.frcmod = cwd / target_frcmod
Expand Down

0 comments on commit c56571b

Please sign in to comment.