web/views/basecontrollers.py
changeset 5159 2543cfa5d54a
parent 5155 1dea6e0fdfc1
parent 5151 2f70fa8b6854
child 5174 78438ad513ca
--- a/web/views/basecontrollers.py	Tue Apr 06 18:51:17 2010 +0200
+++ b/web/views/basecontrollers.py	Tue Apr 06 19:08:07 2010 +0200
@@ -277,7 +277,11 @@
         args = self._cw.form.get('arg', ())
         if not isinstance(args, (list, tuple)):
             args = (args,)
-        args = [simplejson.loads(arg) for arg in args]
+        try:
+            args = [simplejson.loads(arg) for arg in args]
+        except ValueError, exc:
+            self.exception('error while decoding json arguments for js_%s: %s', fname, args, exc)
+            raise RemoteCallFailed(repr(exc))
         try:
             result = func(*args)
         except (RemoteCallFailed, DirectResponse):
@@ -442,6 +446,7 @@
         view = req.vreg['views'].select('doreledit', req, rset=rset, rtype=args['rtype'])
         stream = view.set_stream()
         view.render(**args)
+        # XXX why not _call_view ?
         extresources = req.html_headers.getvalue(skiphead=True)
         if extresources:
             stream.write(u'<div class="ajaxHtmlHead">\n')