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>
This commit is contained in:
Mike Frysinger 2019-10-01 01:01:33 -04:00
parent 9bfdfbe117
commit 9775a3d5d2

View File

@ -16,7 +16,6 @@
from command import PagedCommand from command import PagedCommand
from color import Coloring from color import Coloring
from error import NoSuchProjectError
from git_refs import R_M from git_refs import R_M
class _Coloring(Coloring): class _Coloring(Coloring):
@ -82,10 +81,8 @@ class Info(PagedCommand):
self.out.nl() self.out.nl()
def printDiffInfo(self, args): def printDiffInfo(self, args):
try: # We let exceptions bubble up to main as they'll be well structured.
projs = self.GetProjects(args) projs = self.GetProjects(args)
except NoSuchProjectError:
return
for p in projs: for p in projs:
self.heading("Project: ") self.heading("Project: ")