summaryrefslogtreecommitdiff
path: root/bin/sql_db.py
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sql_db.py')
-rw-r--r--bin/sql_db.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/sql_db.py b/bin/sql_db.py
index 95d1f7d24be..aed10423bb7 100644
--- a/bin/sql_db.py
+++ b/bin/sql_db.py
@@ -297,7 +297,11 @@ class ConnectionPool(object):
# note: this code is called only if the for loop has completed (no break)
raise PoolError('The Connection Pool Is Full')
- result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
+ try:
+ result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
+ except psycopg2.Error, e:
+ self.__logger.exception('Connection to the database failed')
+ raise
self._connections.append((result, True))
self._debug('Create new connection')
return result