[cleanup] tb already printed by self.exception; add note stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 31 Mar 2010 14:32:07 +0200
branchstable
changeset 5113 f8cbdb51e6d4
parent 5112 5bf8baecfaf8
child 5114 55b8b7a5bc4a
[cleanup] tb already printed by self.exception; add note
web/views/basecontrollers.py
web/views/bookmark.py
--- a/web/views/basecontrollers.py	Wed Mar 31 14:28:40 2010 +0200
+++ b/web/views/basecontrollers.py	Wed Mar 31 14:32:07 2010 +0200
@@ -282,8 +282,6 @@
         except RemoteCallFailed:
             raise
         except Exception, ex:
-            import traceback
-            traceback.print_exc()
             self.exception('an exception occured while calling js_%s(%s): %s',
                            fname, args, ex)
             raise RemoteCallFailed(repr(ex))
@@ -392,7 +390,18 @@
         else: # we receive unicode keys which is not supported by the **syntax
             extraargs = dict((str(key), value)
                              for key, value in extraargs.items())
-        comp = self._cw.vreg[registry].select(compid, self._cw, rset=rset, **extraargs)
+        # XXX while it sounds good, addition of the try/except below cause pb:
+        # when filtering using facets return an empty rset, the edition box
+        # isn't anymore selectable, as expected. The pb is that with the
+        # try/except below, we see a "an error occured" message in the ui, while
+        # we don't see it without it. Proper fix would probably be to deal with
+        # this by allowing facet handling code to tell to js_component that such
+        # error is expected and should'nt be reported.
+        #try:
+        comp = self._cw.vreg[registry].select(compid, self._cw, rset=rset,
+                                              **extraargs)
+        #except NoSelectableObject:
+        #    raise RemoteCallFailed('unselectable')
         extraargs = extraargs or {}
         stream = comp.set_stream()
         comp.render(**extraargs)
--- a/web/views/bookmark.py	Wed Mar 31 14:28:40 2010 +0200
+++ b/web/views/bookmark.py	Wed Mar 31 14:32:07 2010 +0200
@@ -113,7 +113,7 @@
                     # we can't edit shared bookmarks we don't own
                     bookmarksrql = 'Bookmark B WHERE B bookmarked_by U, B owned_by U, U eid %(x)s'
                     erset = req.execute(bookmarksrql, {'x': ueid}, 'x',
-                                                build_descr=False)
+                                        build_descr=False)
                     bookmarksrql %= {'x': ueid}
                 if erset:
                     url = self._cw.build_url(vid='muledit', rql=bookmarksrql)