Explorar el Código

Changed exception handling when disposing engine

ogert hace 4 años
padre
commit
51ead65f7a
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      cdplib/db_handlers/SQLHandler.py

+ 3 - 3
cdplib/db_handlers/SQLHandler.py

@@ -637,7 +637,7 @@ class SQLHandler:
 
     def dispose_engine(self):
         try:
-            if self._engine.closed:
-                self._engine.dispose()
+            self._engine.dispose()
         except Exception as e:
-            self._log.log_and_raise_error(('An error occured when trying to dispose the SQL engine. Error: {}').format(e))
+            self._log.error(('An error occured when trying to dispose the SQL engine. Error: {}').format(e))
+            raise Exception(e)