diff options
| author | Tristan Hill (credativ) <> | 2010-11-24 15:11:33 +0530 |
|---|---|---|
| committer | Yogesh Sakhreliya <ysa@tinyerp.com> | 2010-11-24 15:11:33 +0530 |
| commit | 2bf0a92b7f1574c1ecaded4e54625abaf2315a95 (patch) | |
| tree | f130c276c627fdaf28752415c53a99c59f73716c /bin/sql_db.py | |
| parent | b140c3cacbedb2bd0ce121f6daedc1277eca84ad (diff) | |
add error log message if raise exception on database connect
bzr revid: ysa@tinyerp.com-20101124094133-ayl5pppdjqkx534q
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 6c2c17beeb3..feafc72d6d8 100644 --- a/bin/sql_db.py +++ b/bin/sql_db.py @@ -290,7 +290,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.log(logging.ERROR, 'connect:%s', e) + raise self._connections.append((result, True)) self._debug('Create new connection') return result |
