proper error when fname isn't specified stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 10 Jun 2009 08:21:27 +0200
branchstable
changeset 2079 aff0950c54c4
parent 2078 362703bff3d4
child 2080 3ea388b5b9d8
proper error when fname isn't specified
web/views/basecontrollers.py
--- a/web/views/basecontrollers.py	Tue Jun 09 21:29:38 2009 +0200
+++ b/web/views/basecontrollers.py	Wed Jun 10 08:21:27 2009 +0200
@@ -239,9 +239,11 @@
         response content type
         """
         self.req.pageid = self.req.form.get('pageid')
-        fname = self.req.form['fname']
         try:
+            fname = self.req.form['fname']
             func = getattr(self, 'js_%s' % fname)
+        except KeyError:
+            raise RemoteCallFailed('no method specified')
         except AttributeError:
             raise RemoteCallFailed('no %s method' % fname)
         # no <arg> attribute means the callback takes no argument