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.bjorge@intel.com>
Cc: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@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/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-