[server.source.native] exceptions should never pass silently
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Wed, 18 Dec 2019 22:07:33 +0100
changeset 12842 e150ed316dfc
parent 12841 fceae84a22dd
child 12843 000cd62eda32
[server.source.native] exceptions should never pass silently
cubicweb/server/sources/native.py
--- a/cubicweb/server/sources/native.py	Thu Dec 19 15:13:10 2019 +0100
+++ b/cubicweb/server/sources/native.py	Wed Dec 18 22:07:33 2019 +0100
@@ -717,8 +717,9 @@
                     query_debug_informations["rollback"] = True
                     if self.repo.config.mode != 'test':
                         self.debug('transaction has been rolled back')
-                except Exception:
-                    pass
+                except Exception as rollback_exc:
+                    self.warning('exception raised and ignored during rollback %s:\n%s',
+                                 rollback_exc, traceback.format_exc(limit=2))
             if any(cls.__name__ for cls in ex.__class__.__mro__
                    if cls.__name__ == 'IntegrityError'):
                 # need string comparison because of various backends