cubicweb/server/sources/native.py
branch3.26
changeset 12586 afafc8fd9a45
parent 12432 2fcb53ee5178
child 12591 f5f83d72ba8d
child 12726 1a2c7d6397ec
--- a/cubicweb/server/sources/native.py	Tue Apr 16 15:49:03 2019 +0200
+++ b/cubicweb/server/sources/native.py	Mon Apr 08 11:24:53 2019 +0200
@@ -695,7 +695,8 @@
                         self.debug('transaction has been rolled back')
                 except Exception:
                     pass
-            if ex.__class__.__name__ == 'IntegrityError':
+            if any(cls.__name__ for cls in ex.__class__.__mro__
+                   if cls.__name__ == 'IntegrityError'):
                 # need string comparison because of various backends
                 for arg in ex.args:
                     # postgres, sqlserver