[Zope3-dev] RFC: Handling HTTP DELETE errors

Marius Gedminas mgedmin at b4net.lt
Thu Dec 1 10:31:15 EST 2005


Hi folks,

When you do HTTP DELETE on objects that do not explicitly support
deletion, the default view (zope.app.http.delete.DELETE) tries to adapt
self.context.__parent__ to IWriteDirectory, which raises a TypeError
which is never caught. I suggest changing the view to raise
MethodNotAllowed instead when there is no adapter:

        dir = IWriteDirectory(container, None)
        if dir is None:
            raise MethodNotAllowed(self.context, self.request)

If there are no objections, I will write a test and make this change to
Zope 3 trunk.

(This is also http://www.zope.org/Collectors/Zope3-dev/497, but I
thought more people would see my request for comments if I posted it
here.)

Marius Gedminas
-- 
9. Okay, then, what do you think about "syntactic noise" in config files?

!@#@!#(#%^!%$@#';,!@# 
	-- http://open.nit.ca/wiki/index.php?page=RetchMail
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20051201/2024f65a/attachment.bin


More information about the Zope3-dev mailing list