From 87ea5913f2bd10351ae422985154e740e601669e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarkko=20P=C3=B6yry?= Date: Fri, 19 Jun 2015 15:39:25 -0700 Subject: [PATCH] Improve error message when syncing a project with invalid groups. Change-Id: Iaf5c2a0f00667dc09bcf455cfe2f39bfbaa2bfc0 --- main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.py b/main.py index 47f083df..6736abc9 100755 --- a/main.py +++ b/main.py @@ -45,6 +45,7 @@ from command import MirrorSafeCommand from subcmds.version import Version from editor import Editor from error import DownloadError +from error import InvalidProjectGroupsError from error import ManifestInvalidRevisionError from error import ManifestParseError from error import NoManifestException @@ -173,6 +174,12 @@ class _Repo(object): else: print('error: no project in current directory', file=sys.stderr) result = 1 + except InvalidProjectGroupsError as e: + if e.name: + print('error: project group must be enabled for project %s' % e.name, file=sys.stderr) + else: + print('error: project group must be enabled for the project in the current directory', file=sys.stderr) + result = 1 finally: elapsed = time.time() - start hours, remainder = divmod(elapsed, 3600)