[c-c shell/upgrade] raise ExecutionError when traceback is not relevant stable
authorJulien Jehannet <julien.jehannet@logilab.fr>
Fri, 30 Jul 2010 16:01:28 +0200
branchstable
changeset 6323 a11c1e3c16c3
parent 6322 711e7e8c69e3
child 6324 bdb85e3602c8
[c-c shell/upgrade] raise ExecutionError when traceback is not relevant
server/migractions.py
--- a/server/migractions.py	Thu Sep 23 15:30:54 2010 +0200
+++ b/server/migractions.py	Fri Jul 30 16:01:28 2010 +0200
@@ -205,7 +205,7 @@
                          askconfirm=True):
         # check
         if not osp.exists(backupfile):
-            raise Exception("Backup file %s doesn't exist" % backupfile)
+            raise ExecutionError("Backup file %s doesn't exist" % backupfile)
         if askconfirm and not self.confirm('Restore %s database from %s ?'
                                            % (self.config.appid, backupfile)):
             return
@@ -219,7 +219,7 @@
         else:
             for name in bkup.getnames():
                 if name[0] in '/.':
-                    raise Exception('Security check failed, path starts with "/" or "."')
+                    raise ExecutionError('Security check failed, path starts with "/" or "."')
             bkup.close() # XXX seek error if not close+open !?!
             bkup = tarfile.open(backupfile, 'r|gz')
             bkup.extractall(path=tmpdir)
@@ -791,8 +791,8 @@
             try:
                 specialized.eid = instschema[specialized].eid
             except KeyError:
-                raise Exception('trying to add entity type but parent type is '
-                                'not yet in the database schema')
+                raise ExecutionError('trying to add entity type but parent type is '
+                                     'not yet in the database schema')
             self.rqlexecall(ss.eschemaspecialize2rql(eschema), ask_confirm=confirm)
         # register entity's attributes
         for rschema, attrschema in eschema.attribute_definitions():