From 35ee7ef9d058ed96362ab37af26990afcbefb8ae Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Fri, 17 Jan 2025 16:34:12 -0500 Subject: [PATCH] fix: Enhance parse error message --- src/NvGet/Extensions/XmlDocumentExtensions.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/NvGet/Extensions/XmlDocumentExtensions.cs b/src/NvGet/Extensions/XmlDocumentExtensions.cs index fd0f6f9..6ca9f3b 100644 --- a/src/NvGet/Extensions/XmlDocumentExtensions.cs +++ b/src/NvGet/Extensions/XmlDocumentExtensions.cs @@ -204,7 +204,14 @@ public static async Task LoadDocument(this string path, Cancellatio PreserveWhitespace = true, }; - document.Load(path); + try + { + document.Load(path); + } + catch(Exception e) + { + throw new Exception($"Failed to parse file {path}", e); + } #endif return document;