Explorar o código

Changed exception handling when disposing engine

ogert %!s(int64=4) %!d(string=hai) anos
pai
achega
51ead65f7a
Modificáronse 1 ficheiros con 3 adicións e 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)