diff options
| author | nvi-openerp <nicolas.vanhoren@openerp.com> | 2010-12-08 11:52:49 +0100 |
|---|---|---|
| committer | nvi-openerp <nicolas.vanhoren@openerp.com> | 2010-12-08 11:52:49 +0100 |
| commit | 38569b7754bb2e1dc1b6e8d58df626ff0fafaedb (patch) | |
| tree | e0ad1d56381f8f0e4d288c0f50407191ab8ac7a7 /bin/sql_db.py | |
| parent | 8cc1c1086d2243678e2fef9c1631758ac517d097 (diff) | |
| parent | 00f2f6b97d71f43fe38c0ade7875864dd7ef564b (diff) | |
[merge]
bzr revid: nicolas.vanhoren@openerp.com-20101206091222-miwtrvjkfh8hy8ec
bzr revid: nicolas.vanhoren@openerp.com-20101206174010-f819dzx7vyw2jntk
bzr revid: nicolas.vanhoren@openerp.com-20101207132443-z0wabhbh0ruzwoo2
bzr revid: nicolas.vanhoren@openerp.com-20101208105249-qfjalxkboqpi9xr0
Diffstat (limited to 'bin/sql_db.py')
| -rw-r--r-- | bin/sql_db.py | 6 |
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 |
