[CalendarServer-changes] [82] CalendarServer/branches/users/cdaboo/acl-merge/twistedcaldav/static.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Aug 30 08:26:35 PDT 2006


Revision: 82
Author:   cdaboo at apple.com
Date:     2006-08-30 08:26:32 -0700 (Wed, 30 Aug 2006)

Log Message:
-----------
Raise exceptions when calendar creation fails rather than return error responses.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/acl-merge/twistedcaldav/static.py

Modified: CalendarServer/branches/users/cdaboo/acl-merge/twistedcaldav/static.py
===================================================================
--- CalendarServer/branches/users/cdaboo/acl-merge/twistedcaldav/static.py	2006-08-30 15:20:37 UTC (rev 81)
+++ CalendarServer/branches/users/cdaboo/acl-merge/twistedcaldav/static.py	2006-08-30 15:26:32 UTC (rev 82)
@@ -138,11 +138,11 @@
 
         if self.fp.exists():
             log.err("Attempt to create collection where file exists: %s" % (self.fp.path,))
-            return fail(responsecode.NOT_ALLOWED)
+            raise HTTPError(StatusResponse(responsecode.NOT_ALLOWED, "File exists"))
 
         if not os.path.isdir(os.path.dirname(self.fp.path)):
             log.err("Attempt to create collection with no parent: %s" % (self.fp.path,))
-            return succeed(StatusResponse(responsecode.CONFLICT, "No parent collection"))
+            raise HTTPError(StatusResponse(responsecode.CONFLICT, "No parent collection"))
 
         #
         # Verify that no parent collection is a calendar also
@@ -152,10 +152,10 @@
         def _defer(parent):
             if parent is not None:
                 log.err("Cannot create a calendar collection within a calendar collection %s" % (parent,))
-                return ErrorResponse(
+                raise HTTPError(ErrorResponse(
                     responsecode.FORBIDDEN,
                     (caldavxml.caldav_namespace, "calendar-collection-location-ok")
-                )
+                ))
     
             return self.createCalendarCollection()
             

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20060830/9fcc32f6/attachment.html


More information about the calendarserver-changes mailing list