[ms, test] propagate exception in test mode stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 29 Sep 2011 12:55:28 +0200
branchstable
changeset 7885 9454b7ef5ae4
parent 7884 35d2e2f4e10a
child 7886 b1c913a6d9f0
[ms, test] propagate exception in test mode
server/repository.py
server/sources/pyrorql.py
--- a/server/repository.py	Thu Sep 29 12:55:20 2011 +0200
+++ b/server/repository.py	Thu Sep 29 12:55:28 2011 +0200
@@ -1152,6 +1152,8 @@
                     session.execute(rql, {'x': eid, 'seid': scleanup},
                                     build_descr=False)
                 except Exception:
+                    if self.config.mode == 'test':
+                        raise
                     self.exception('error while cascading delete for entity %s '
                                    'from %s. RQL: %s', entity, sourceuri, rql)
         self.system_source.delete_info_multi(session, [entity], sourceuri)
@@ -1182,6 +1184,8 @@
                 try:
                     session.execute(rql, {'seid': scleanup}, build_descr=False)
                 except Exception:
+                    if self.config.mode == 'test':
+                        raise
                     self.exception('error while cascading delete for entity %s '
                                    'from %s. RQL: %s', entities, sourceuri, rql)
         self.system_source.delete_info_multi(session, entities, sourceuri)
--- a/server/sources/pyrorql.py	Thu Sep 29 12:55:20 2011 +0200
+++ b/server/sources/pyrorql.py	Thu Sep 29 12:55:28 2011 +0200
@@ -289,6 +289,8 @@
                         repo.delete_info(session, entity, self.uri,
                                          scleanup=self.eid)
                 except Exception:
+                    if self.repo.config.mode == 'test':
+                        raise
                     self.exception('while updating %s with external id %s of source %s',
                                    etype, extid, self.uri)
                     continue