From 5f434ed723ac14cdcea12d038c066c0653e1ef3a Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 22 Nov 2012 13:48:10 +0900 Subject: [PATCH] Exit with fatal error if local manifest file cannot be parsed If the .repo/local_manifests folder includes a local manifest file that cannot be parsed, the current behaviour is to catch the parse exception, print a warning, and continue to process remaining files. This can cause any errors to go unnoticed. Remove the exception handling, so that the exception is instead caught in main._Main, and repo exits with a fatal error. Change-Id: I75a70b7b850d2eb3e4ac99d435a4568ff598b7f4 --- manifest_xml.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/manifest_xml.py b/manifest_xml.py index e8693ba8..07f0c66a 100644 --- a/manifest_xml.py +++ b/manifest_xml.py @@ -344,11 +344,8 @@ class XmlManifest(object): try: for local_file in sorted(os.listdir(local_dir)): if local_file.endswith('.xml'): - try: - local = os.path.join(local_dir, local_file) - nodes.append(self._ParseManifestXml(local, self.repodir)) - except ManifestParseError as e: - print('%s' % str(e), file=sys.stderr) + local = os.path.join(local_dir, local_file) + nodes.append(self._ParseManifestXml(local, self.repodir)) except OSError: pass