somewhat handle corrupted database when manually building a database
authorsylvain.thenault@logilab.fr
Thu, 26 Mar 2009 18:21:22 +0100
changeset 1169 52058e8a3af9
parent 1161 936c311010fc
child 1170 a7c089405185
somewhat handle corrupted database when manually building a database
server/session.py
--- a/server/session.py	Thu Mar 26 09:09:58 2009 +0100
+++ b/server/session.py	Thu Mar 26 18:21:22 2009 +0100
@@ -444,10 +444,14 @@
                     # None value inserted by an outer join, no type
                     row_descr[index] = None
                     continue
-                if isfinal:
-                    row_descr[index] = etype_from_pyobj(value)
-                else:
-                    row_descr[index] = etype_from_eid(value)[0]
+                try:
+                    if isfinal:
+                        row_descr[index] = etype_from_pyobj(value)
+                    else:
+                        row_descr[index] = etype_from_eid(value)[0]
+                except UnknownEid:
+                    self.critical('wrong eid in repository, should check database')
+                    row_descr[index] = row[index] = None
             description.append(tuple(row_descr))
         return description