The ETree exception contains additional information about the location
of XML tag errors.  Adding this information to the error message for
better debugging support.

Signed-off-by: Erik Bjorge <erik.c.bjo...@intel.com>
Cc: Ashley E Desimone <ashley.e.desim...@intel.com>
Cc: Nate DeSimone <nathaniel.l.desim...@intel.com>
Cc: Puja Pandya <puja.pan...@intel.com>
Cc: Bret Barkelew <bret.barke...@microsoft.com>
Cc: Prince Agyeman <prince.agye...@intel.com>
---
 edkrepo_manifest_parser/edk_manifest.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/edkrepo_manifest_parser/edk_manifest.py 
b/edkrepo_manifest_parser/edk_manifest.py
index 7e5f0fb..2ec6cd1 100644
--- a/edkrepo_manifest_parser/edk_manifest.py
+++ b/edkrepo_manifest_parser/edk_manifest.py
@@ -51,7 +51,7 @@ GENERAL_CONFIG_MISSING_ERROR = "Unable to locate 
<GeneralConfig>"
 SOURCELIST_EMPTY_ERROR = "Invalid input: empty values in source list"
 INVALID_PROJECTNAME_ERROR = "Invalid input: {} not found in CiIndexXml"
 UNSUPPORTED_TYPE_ERROR = "{} is not a supported xml type: {}"
-INVALID_XML_ERROR = "{} is not a valid xml file"
+INVALID_XML_ERROR = "{} is not a valid xml file ({})"
 
 
 class BaseXmlHelper():
@@ -59,8 +59,8 @@ class BaseXmlHelper():
         self._fileref = fileref
         try:
             self._tree = ET.ElementTree(file=fileref)  # fileref can be a 
filename or filestream
-        except Exception:
-            raise TypeError(INVALID_XML_ERROR.format(fileref))
+        except Exception as et_error:
+            raise TypeError(INVALID_XML_ERROR.format(fileref, et_error))
 
         self._xml_type = self._tree.getroot().tag
         if self._xml_type not in xml_types:
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58485): https://edk2.groups.io/g/devel/message/58485
Mute This Topic: https://groups.io/mt/73386942/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to