diff sat/memory/sqlite.py @ 2889:28fe69b87ba4

core (memory/sqlite): display arguments in logs in case of too many db/interaction tries
author Goffi <goffi@goffi.org>
date Sun, 07 Apr 2019 18:38:18 +0200
parents a425c1ca51d0
children 1a23547f95fd
line wrap: on
line diff
--- a/sat/memory/sqlite.py	Sun Apr 07 15:04:28 2019 +0200
+++ b/sat/memory/sqlite.py	Sun Apr 07 18:38:18 2019 +0200
@@ -150,8 +150,9 @@
             #        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 @@
             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}')