Преглед на файлове

Add try catch block for dispose_engine()

ogert преди 5 години
родител
ревизия
08e6fecd09
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      cdplib/db_handlers/SQLHandler.py

+ 4 - 1
cdplib/db_handlers/SQLHandler.py

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