Would raising HTTPError(responsecode.NOT_FOUND) be more appropriate here?

I know I haven't defined provisionChild() very well yet, but my thinking it that it's not really supposed to be called unless we know the child should exist; the caller should expect it to always work.

Raising should give us a better error result if not handled, where returning None might cause some other (more obscure) error down the line.

  I don't know what the error trace looked like, so I might be wrong.

        -wsv


On Jan 18, 2007, at 11:26 AM, [EMAIL PROTECTED] wrote:

Revision
1059
Author
[EMAIL PROTECTED]
Date
2007-01-18 11:26:46 -0800 (Thu, 18 Jan 2007)
Log Message

Fix 500 error when doing a request on a non-existent user's outbox.
Modified Paths

CalendarServer/trunk/twistedcaldav/static.py
Diff

Modified: CalendarServer/trunk/twistedcaldav/static.py (1058 => 1059)

--- CalendarServer/trunk/twistedcaldav/static.py 2007-01-18 16:57:31 UTC (rev 1058) +++ CalendarServer/trunk/twistedcaldav/static.py 2007-01-18 19:26:46 UTC (rev 1059)
@@ -436,7 +436,10 @@

     def provisionChild(self, name):
record = self.directory.recordWithShortName(self.recordType, name) - assert record is not None, "No directory record %r of type %r" % (name, self.recordType)
+        if record is None:
+ log.msg("No directory record %r of type %r" % (name, self.recordType))
+            return None
+
child = CalendarHomeFile(self.fp.child(name).path, self, record)
         if not child.exists():
# NOTE: provisionDefaultCalendars() returns a deferred, which we are ignoring.
_______________________________________________
calendarserver-changes mailing list
[EMAIL PROTECTED]
http://lists.macosforge.org/mailman/listinfo/calendarserver-changes

_______________________________________________
calendarserver-dev mailing list
calendarserver-dev@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo/calendarserver-dev

Reply via email to