Re: [Zope-Checkins] CVS: Packages/webdav - NullResource.py:1.39.62.4

"Stefan H. Holek" <[email protected]>
Newsgroups gmane.comp.web.zope.coders
Message-ID <[email protected]>
Don't you want an "except ConflictError: raise" here too?

Stefan


On 17. Dez 2004, at 05:39, Chris McDonough wrote:

> Update of /cvs-repository/Packages/webdav
> In directory cvs.zope.org:/tmp/cvs-serv16313
>
> Modified Files:
>       Tag: Zope-2_7-branch
> 	NullResource.py
> Log Message:
> Don't raise Forbidden when we don't know what else to do.  Instead, 
> let the real error propagate but catch CopyError, which really means 
> Unauthorized in this case.
>
>
> === Packages/webdav/NullResource.py 1.39.62.3 => 1.39.62.4 ===
> --- Packages/webdav/NullResource.py:1.39.62.3	Wed Dec  1 18:01:48 2004
> +++ Packages/webdav/NullResource.py	Thu Dec 16 23:39:30 2004
> @@ -28,6 +28,7 @@
>  from zExceptions import MethodNotAllowed
>  from common import isDavCollection
>  from common import Locked, Conflict, PreconditionFailed, 
> UnsupportedMediaType
> +from OFS.CopySupport import CopyError
>
>  class NullResource(Persistent, Acquisition.Implicit, Resource):
>      """Null resources are used to handle HTTP method calls on
> @@ -143,10 +144,8 @@
>          # check the clipboard.
>          try:
>              parent._verifyObjectPaste(ob.__of__(parent), 0)
> -        except Unauthorized:
> -            raise
> -        except:
> -            raise Forbidden, sys.exc_info()[1]
> +        except CopyError:
> +            raise Unauthorized, sys.exc_info()[1]
>
>          # Delegate actual PUT handling to the new object,
>          # SDS: But just *after* it has been stored.
>
> _______________________________________________
> Zope-Checkins maillist  -  [email protected]
> http://mail.zope.org/mailman/listinfo/zope-checkins
>
--
The time has come to start talking about whether the emperor is as well
dressed as we are supposed to think he is.               /Pete McBreen/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.