[CalendarServer-changes] [9336] CalendarServer/trunk/calendarserver/tools/shell/cmd.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Jun 7 13:39:16 PDT 2012


Revision: 9336
          http://trac.macosforge.org/projects/calendarserver/changeset/9336
Author:   wsanchez at apple.com
Date:     2012-06-07 13:39:15 -0700 (Thu, 07 Jun 2012)
Log Message:
-----------
raise NotFoundError in getTargets() if appropriate

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tools/shell/cmd.py

Modified: CalendarServer/trunk/calendarserver/tools/shell/cmd.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/shell/cmd.py	2012-06-06 00:37:39 UTC (rev 9335)
+++ CalendarServer/trunk/calendarserver/tools/shell/cmd.py	2012-06-07 20:39:15 UTC (rev 9336)
@@ -134,7 +134,13 @@
         if tokens:
             result = []
             for token in tokens:
-                result.append((yield self.wd.locate(token.split("/"))))
+                try:
+                    target = (yield self.wd.locate(token.split("/")))
+                except NotFoundError:
+                    raise UsageError("No such target: %s" % (token,))
+
+                result.append(target)
+
             returnValue(result)
         else:
             if wdFallback:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120607/e1c7a1b8/attachment.html>


More information about the calendarserver-changes mailing list