Skip to content

Commit

Permalink
Merge pull request #3 from molssi-seamm/dev
Browse files Browse the repository at this point in the history
Improved error reporting.
  • Loading branch information
seamm authored Jan 31, 2025
2 parents 89115c6 + 89c57cc commit 59910c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
=======
History
=======
2025.1.31 -- Improved error reporting.
* Caught more errors and provided more informative error messages

2024.10.20 -- Added to the functionality and consolidated the code
* Added method to calculate the Hessian via finite differences using ASE
* Added references and citations where appropriate
Expand Down
8 changes: 6 additions & 2 deletions seamm_ase/seamm_ase.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,14 @@ def run_ase_Hessian(
exception = None
try:
vibrations.run()
result = vibrations.get_vibrations()
except Exception as e: # noqa: F841
exception = e
caught_error = True
print(f"Exception: {exception}")
text = "".join(traceback.format_exception(e))
printer.important(
f"Exception in the finite-difference calculation!\n\n{text}"
)

# Clean up the subdirectories
if caught_error:
Expand All @@ -540,7 +544,7 @@ def run_ase_Hessian(
for subdirectory in subdirectories[:-1]:
shutil.rmtree(subdirectory)

return vibrations.get_vibrations()
return result

def run_ase_optimizer(self, P, PP):
"""Run a Structure step.
Expand Down

0 comments on commit 59910c3

Please sign in to comment.