[Bug 833376] [NEW] Attempting to PATCH an invalid attribute on a member object in REST API results in 500, instead of 400.

Stephen A. Goss steveth45 at gmail.com
Wed Aug 24 23:09:22 CEST 2011


Public bug reported:

If you send a PATCH request to a member with an invalid parameter
(anything other than "address", at the moment) you get a 500 response,
instead of a 400 Bad Request.  Here is the unhandled exception
generating the 500 error:

Traceback (most recent call last):
  File "/usr/lib64/python2.6/wsgiref/handlers.py", line 93, in run
    self.result = application(self.environ, self.start_response)
  File "/home/sgoss/mailman_clone/src/mailman/rest/wsgiapp.py", line 58, in __call__
    environ, start_response)
  File "/home/sgoss/phoenix-deploy/lib/python2.6/site-packages/restish-0.12.1-py2.6.egg/restish/app.py", line 18, in __call__
    response = self.get_response(request, resource_or_response)
  File "/home/sgoss/phoenix-deploy/lib/python2.6/site-packages/restish-0.12.1-py2.6.egg/restish/app.py", line 65, in get_response
    resource_or_response = resource_or_response(request)
  File "/home/sgoss/phoenix-deploy/lib/python2.6/site-packages/restish-0.12.1-py2.6.egg/restish/resource.py", line 212, in __call__
    return _dispatch(request, match, lambda r: callable(self, r))
  File "/home/sgoss/phoenix-deploy/lib/python2.6/site-packages/restish-0.12.1-py2.6.egg/restish/resource.py", line 243, in _dispatch
    response = func(request)
  File "/home/sgoss/phoenix-deploy/lib/python2.6/site-packages/restish-0.12.1-py2.6.egg/restish/resource.py", line 212, in <lambda>
    return _dispatch(request, match, lambda r: callable(self, r))
  File "/home/sgoss/mailman_clone/src/mailman/rest/helpers.py", line 199, in __call__
    return self.func(resource, request)
  File "/home/sgoss/mailman_clone/src/mailman/rest/members.py", line 129, in patch_membership
    values = Validator(address=unicode)(request)
  File "/home/sgoss/mailman_clone/src/mailman/rest/validator.py", line 88, in __call__
    raise ValueError('Unexpected parameters: {0}'.format(extras))
ValueError: Unexpected parameters: delivery_mode

** Affects: mailman
     Importance: Undecided
         Status: New


** Tags: mailman3

-- 
You received this bug notification because you are a member of Mailman
Coders, which is subscribed to GNU Mailman.
https://bugs.launchpad.net/bugs/833376

Title:
  Attempting to PATCH an invalid attribute on a member object in REST
  API results in 500, instead of 400.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mailman/+bug/833376/+subscriptions


More information about the Mailman-coders mailing list