core (memory/sqlite): display arguments in logs in case of too many db/interaction tries

This commit is contained in:
Goffi 2019-04-07 18:38:18 +02:00
commit aac5e58ec6

View file

@ -150,8 +150,9 @@ class ConnectionPool(adbapi.ConnectionPool):
# Sqlite integration, probably with high level library
retry -= 1
if retry == 0:
log.error(_(u'too many db tries, we abandon! Error message: {msg}')
.format(msg = e))
log.error(_(u'too many db tries, we abandon! Error message: {msg}\n'
u'query was {query}'
.format(msg=e, query=u' '.join([unicode(a) for a in args]))))
raise e
log.warning(
_(u'exception while running query, retrying ({try_}): {msg}').format(
@ -172,8 +173,9 @@ class ConnectionPool(adbapi.ConnectionPool):
retry -= 1
if retry == 0:
log.error(
_(u'too many interaction tries, we abandon! Error message: {msg}')
.format(msg = e))
_(u'too many interaction tries, we abandon! Error message: {msg}\n'
u'interaction was {args}'
.format(msg=e, args=u' '.join([unicode(a) for a in args]))))
raise e
log.warning(
_(u'exception while running interaction, retrying ({try_}): {msg}')