From 0b8df7be79d2b8b5d5a884fc2b0d070b42861459 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 13 Nov 2012 09:51:57 +0900 Subject: [PATCH] Handle manifest parse errors in main Add handling of manifest parse errors in the main method, and print an error. This will prevent python tracebacks being dumped in many cases. Change-Id: I75e73539afa34049f73c993dbfda203f1ad33b45 --- main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.py b/main.py index 6236dd3d..5e575c56 100755 --- a/main.py +++ b/main.py @@ -49,6 +49,7 @@ from subcmds.version import Version from editor import Editor from error import DownloadError from error import ManifestInvalidRevisionError +from error import ManifestParseError from error import NoSuchProjectError from error import RepoChangedException from manifest_xml import XmlManifest @@ -397,6 +398,9 @@ def _Main(argv): close_ssh() except KeyboardInterrupt: result = 1 + except ManifestParseError as mpe: + print >>sys.stderr, 'fatal: %s' % mpe + result = 1 except RepoChangedException as rce: # If repo changed, re-exec ourselves. #