cubicweb/server/sources/native.py
changeset 12591 f5f83d72ba8d
parent 12567 26744ad37953
parent 12586 afafc8fd9a45
child 12614 8ac9ac8d9143
--- a/cubicweb/server/sources/native.py	Wed May 08 21:37:13 2019 +0200
+++ b/cubicweb/server/sources/native.py	Fri May 10 15:58:01 2019 +0200
@@ -690,7 +690,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