Use try except for db connection in osmenrich (#112)

* Use try-except clause for establishing DB connection in osm-enrich
pull/114/head
mazano 2021-04-08 22:10:07 +02:00 zatwierdzone przez GitHub
rodzic 32ef0ed320
commit 1c01ae7441
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -216,8 +216,11 @@ class Enrich(object):
def check_database(self):
"""Test connection to PostGIS and create the URI."""
connection = self.create_connection()
cursor = connection.cursor()
try:
connection = self.create_connection()
cursor = connection.cursor()
except OperationalError as e:
print(e)
try:
for table, table_data in self.mapping_database_schema.items():
new_columns_postgis = []