kopia lustrzana https://github.com/kartoza/docker-osm
Use try except for db connection in osmenrich (#112)
* Use try-except clause for establishing DB connection in osm-enrichpull/114/head
rodzic
32ef0ed320
commit
1c01ae7441
|
@ -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 = []
|
||||
|
|
Ładowanie…
Reference in New Issue