From 9775a3d5d2dcba0b33fbcf6a911b924be8f9a6e7 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 1 Oct 2019 01:01:33 -0400 Subject: 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 Tested-by: Mike Frysinger --- subcmds/info.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'subcmds/info.py') diff --git a/subcmds/info.py b/subcmds/info.py index be5a8f2a..0d5696dd 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 @@ class Info(PagedCommand): 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: ") -- cgit v1.2.3-54-g00ecf