DateFieldMarshaller causes internal server error

Bug #275908 reported by Edwin Grubbs
2
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Undecided
Edwin Grubbs

Bug Description

The DateFieldMarshaller raises a DateError, which causes an Internal Server Error response, but it should raise a ValueError, which will cause a Bad Request response.

Traceback (most recent call last):
  File "/srv/staging.launchpad.net/staging/launchpad/lib/zope/publisher/publish.py", line 138, in publish
    result = publication.callObject(request, object)
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/launchpad/webapp/publication.py", line 332, in callObject
    return mapply(ob, request.getPositionalArguments(), request)
  File "/srv/staging.launchpad.net/staging/launchpad/lib/zope/publisher/publish.py", line 113, in mapply
    return debug_call(object, args)
  File "/srv/staging.launchpad.net/staging/launchpad/lib/zope/publisher/publish.py", line 119, in debug_call
    return object(*args)
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/lazr/rest/resource.py", line 545, in __call__
    result = self.do_POST()
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/lazr/rest/resource.py", line 505, in do_POST
    return self.handleCustomPOST(operation_name)
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/lazr/rest/resource.py", line 489, in handleCustomPOST
    return operation()
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/lazr/rest/operation.py", line 49, in __call__
    values, errors = self.validate()
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/lazr/rest/operation.py", line 155, in validate
    value = marshaller.marshall_from_request(
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/lazr/rest/marshallers.py", line 137, in marshall_from_request
    return self._marshall_from_request(value)
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/lazr/rest/marshallers.py", line 144, in _marshall_from_request
    return self._marshall_from_json_data(value)
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/lazr/rest/marshallers.py", line 311, in _marshall_from_json_data
    value = DateTimeParser().parse(value)
  File "/srv/staging.launchpad.net/staging/launchpad/lib/zope/app/datetimeutils.py", line 536, in parse
    raise DateError(arg, yr, mo, dy)
DateError: (u'2008-10-33', 2008, 10, 33)

Tags: lp-registry
Changed in launchpad-registry:
assignee: nobody → edwin-grubbs
status: New → In Progress
milestone: none → 2.1.10
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Revision 7109

Changed in launchpad-registry:
status: In Progress → Fix Committed
Changed in launchpad-registry:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.