Updated connection exception to provide more info on the cause.
Fixes #178
This commit is contained in:
parent
3246cf8bdd
commit
3861103585
@ -31,8 +31,8 @@ def _get_connection(reconnect=False):
|
|||||||
if _connection.get(identity) is None or reconnect:
|
if _connection.get(identity) is None or reconnect:
|
||||||
try:
|
try:
|
||||||
_connection[identity] = Connection(**_connection_settings)
|
_connection[identity] = Connection(**_connection_settings)
|
||||||
except:
|
except Exception, e:
|
||||||
raise ConnectionError('Cannot connect to the database')
|
raise ConnectionError("Cannot connect to the database:\n%s" % e)
|
||||||
return _connection[identity]
|
return _connection[identity]
|
||||||
|
|
||||||
def _get_db(reconnect=False):
|
def _get_db(reconnect=False):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user