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:
|
||||
try:
|
||||
_connection[identity] = Connection(**_connection_settings)
|
||||
except:
|
||||
raise ConnectionError('Cannot connect to the database')
|
||||
except Exception, e:
|
||||
raise ConnectionError("Cannot connect to the database:\n%s" % e)
|
||||
return _connection[identity]
|
||||
|
||||
def _get_db(reconnect=False):
|
||||
|
Loading…
x
Reference in New Issue
Block a user