Revision
9336
Author
wsanchez@apple.com
Date
2012-06-07 13:39:15 -0700 (Thu, 07 Jun 2012)

Log Message

raise NotFoundError in getTargets() if appropriate

Modified Paths

Diff

Modified: CalendarServer/trunk/calendarserver/tools/shell/cmd.py (9335 => 9336)


--- 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: