info: allow NoSuchProjectError to bubble up
If the user passes in bad projects like `repo info asdf`, we currently
silently swallow those and do nothing. Allow NoSuchProjectError to
bubble up to main which will handle & triage this correctly for us.
Change-Id: Ie04528e7b7a164293063a636813a73eaabdd5bc3
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/239238
Reviewed-by: David Pursehouse <dpursehouse@collab.net>
Tested-by: Mike Frysinger <vapier@google.com>
diff --git a/subcmds/info.py b/subcmds/info.py
index be5a8f2..0d5696d 100644
--- a/subcmds/info.py
+++ b/subcmds/info.py
@@ -16,7 +16,6 @@
from command import PagedCommand
from color import Coloring
-from error import NoSuchProjectError
from git_refs import R_M
class _Coloring(Coloring):
@@ -82,10 +81,8 @@
self.out.nl()
def printDiffInfo(self, args):
- try:
- projs = self.GetProjects(args)
- except NoSuchProjectError:
- return
+ # We let exceptions bubble up to main as they'll be well structured.
+ projs = self.GetProjects(args)
for p in projs:
self.heading("Project: ")