[CalendarServer-changes] [7096] CalendarServer/trunk/twistedcaldav/directory/wiki.py
source_changes at macosforge.org
source_changes at macosforge.org
Thu Mar 3 14:53:08 PST 2011
Revision: 7096
http://trac.macosforge.org/projects/calendarserver/changeset/7096
Author: sagen at apple.com
Date: 2011-03-03 14:53:08 -0800 (Thu, 03 Mar 2011)
Log Message:
-----------
Log an error if the Wiki ACL RPC call fails, say, due to timeout.
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/directory/wiki.py
Modified: CalendarServer/trunk/twistedcaldav/directory/wiki.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/wiki.py 2011-03-02 15:01:02 UTC (rev 7095)
+++ CalendarServer/trunk/twistedcaldav/directory/wiki.py 2011-03-03 22:53:08 UTC (rev 7096)
@@ -28,6 +28,7 @@
from twisted.web.xmlrpc import Proxy, Fault
from twext.web2.http import HTTPError, StatusResponse
from twext.web2.auth.wrapper import UnauthorizedResponse
+from twext.web2 import responsecode
from twext.python.log import Logger
@@ -240,7 +241,7 @@
raise HTTPError(
StatusResponse(
- 403,
+ responsecode.FORBIDDEN,
"You are not allowed to access this wiki"
)
)
@@ -252,8 +253,15 @@
wikiID, fault))
if fault.faultCode == 2: # non-existent user
- raise HTTPError(StatusResponse(403, fault.faultString))
+ raise HTTPError(StatusResponse(responsecode.FORBIDDEN, fault.faultString))
else: # fault.faultCode == 12, non-existent wiki
- raise HTTPError(StatusResponse(404, fault.faultString))
+ raise HTTPError(StatusResponse(responsecode.NOT_FOUND, fault.faultString))
+ except HTTPError:
+ # pass through the HTTPError we might have raised above
+ raise
+
+ except Exception, e:
+ log.error("Wiki ACL RPC failed: %s" % (e,))
+ raise HTTPError(StatusResponse(responsecode.SERVICE_UNAVAILABLE, "Wiki ACL RPC failed"))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110303/e4dbac9e/attachment.html>
More information about the calendarserver-changes
mailing list