From 0bdd8ab622c01b45632f69cd38fdf7abe15406a4 Mon Sep 17 00:00:00 2001
From: Alvin Noe Ladines <ladinesalvinnoe@gmail.com>
Date: Tue, 26 Jan 2021 18:29:26 +0100
Subject: [PATCH] Added error handler in reading fhiaims

---
 phonopyparser/fhiaims_io.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/phonopyparser/fhiaims_io.py b/phonopyparser/fhiaims_io.py
index 4d37d80..ff9a820 100644
--- a/phonopyparser/fhiaims_io.py
+++ b/phonopyparser/fhiaims_io.py
@@ -134,7 +134,8 @@ def read_forces_aims(cell_obj, supercell_matrix, displacement, sym, tol=1e-6, lo
                     check_var = True
                     break
             if not check_var:
-                raise Exception("No phonon calculations found")
+                logger.error("No phonon calculations found")
+                return set_of_forces, phonopy_obj, Relative_Path
             os.chdir("../")
         Relative_Path.append(aims_out)
         supercell_calculated = read_aims_output(aims_out)
@@ -162,6 +163,6 @@ def read_forces_aims(cell_obj, supercell_matrix, displacement, sym, tol=1e-6, lo
                 force -= drift_force / forces.shape[0]
             set_of_forces.append(forces)
         else:
-            raise Exception("calculated varies from expected supercell in FHI-aims output %s" % aims_out)
+            logger.error("calculated varies from expected supercell in FHI-aims output")
 
     return set_of_forces, phonopy_obj, Relative_Path
-- 
GitLab