web/facet.py
changeset 346 5bbb01a133ae
parent 203 60cd67acf7fd
child 368 84a5106840fa
--- a/web/facet.py	Wed Jan 07 15:00:30 2009 +0100
+++ b/web/facet.py	Wed Jan 07 15:36:59 2009 +0100
@@ -356,7 +356,12 @@
             mainvar = self.filtered_variable
             insert_attr_select_relation(rqlst, mainvar, self.rtype, self.role,
                                         self.target_attr, self.sortfunc, self.sortasc)
-            rset = self.rqlexec(rqlst.as_string(), self.rset.args, self.rset.cachekey)
+            try:
+                rset = self.rqlexec(rqlst.as_string(), self.rset.args, self.rset.cachekey)
+            except:
+                self.exception('error while getting vocabulary for %s, rql: %s',
+                               self, rqlst.as_string())
+                return ()
         finally:
             rqlst.recover()
         return self.rset_vocabulary(rset)
@@ -436,8 +441,12 @@
             _cleanup_rqlst(rqlst, mainvar)
             newvar, rel = _prepare_vocabulary_rqlst(rqlst, mainvar, self.rtype, self.role)
             _set_orderby(rqlst, newvar, self.sortasc, self.sortfunc)
-            rset = self.rqlexec(rqlst.as_string(), self.rset.args,
-                                self.rset.cachekey)
+            try:
+                rset = self.rqlexec(rqlst.as_string(), self.rset.args, self.rset.cachekey)
+            except:
+                self.exception('error while getting vocabulary for %s, rql: %s',
+                               self, rqlst.as_string())
+                return ()
         finally:
             rqlst.recover()
         return self.rset_vocabulary(rset)