-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[XC] Add file info to exception reports #25359
Conversation
cd36dff
to
9aefceb
Compare
9aefceb
to
879ebb9
Compare
@@ -76,7 +76,7 @@ static void ParseXamlElementFor(IElementNode node, XmlReader reader) | |||
name = new XmlName(reader.NamespaceURI, reader.LocalName); | |||
|
|||
if (node.Properties.ContainsKey(name)) | |||
throw new XamlParseException($"'{reader.Name}' is a duplicate property name.", (IXmlLineInfo)reader); | |||
throw new XamlParseException($"'{reader.Name}' is a duplicate property name.", ((IXmlLineInfo)reader).Clone()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reader is disposed before the message is logged, so the line info was missing
var rootnode = ParseXaml(resource.GetResourceStream(), typeDef); | ||
if (rootnode == null) | ||
ILRootNode rootnode = null; | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this try/catch is the main change, the rest is pulling #22808
@StephaneDelcroix Could you rebase? Thanks in advance. |
879ebb9
to
a6dc06b
Compare
a6dc06b
to
c6a6f29
Compare
Description of Change
When the XamlParser throws an exception while executed from XamlC, the file info is missing from the log, and the whole XamlC process fails, so it only reports one issue at a time.
It now logs things like
Issues Fixed
Fixes #21038