[server/initrepo] show failed sql statements and abort if necessary (closes #3308564) stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 24 Oct 2013 18:28:18 +0200
branchstable
changeset 9333 22423634d06d
parent 9332 7a5d46db5c36
child 9334 ea12401c0a68
[server/initrepo] show failed sql statements and abort if necessary (closes #3308564)
server/__init__.py
--- a/server/__init__.py	Wed Nov 27 16:18:54 2013 +0100
+++ b/server/__init__.py	Thu Oct 24 18:28:18 2013 +0200
@@ -205,7 +205,11 @@
     schemasql = sqlschema(schema, driver)
     #skip_entities=[str(e) for e in schema.entities()
     #               if not repo.system_source.support_entity(str(e))])
-    sqlexec(schemasql, execute, pbtitle=_title, delimiter=';;')
+    failed = sqlexec(schemasql, execute, pbtitle=_title, delimiter=';;')
+    if failed:
+        print 'The following SQL statements failed. You should check your schema.'
+        print failed
+        raise Exception('execution of the sql schema failed, you should check your schema')
     sqlcursor.close()
     sqlcnx.commit()
     sqlcnx.close()