-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[flutter_tools] Catch more general XmlException rather than XmlParserException #107574
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
[flutter_tools] Catch more general XmlException rather than XmlParserException #107574
Conversation
| document = XmlDocument.parse(manifestFile.readAsStringSync()); | ||
| } on XmlParserException { | ||
| return false; | ||
| } on XmlTagException { |
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.
Here I had previously added additional handling for XmlTagException, however this wouldn't have caught an XmlParentException or XmlNodeTypeException
Jasguerrero
left a comment
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.
LGTM
Fixes #106365
In package:xml, there are many possible types of exceptions that could be thrown from an invalid Xml document; however, historically the tool has only caught XmlParserException. This changes the exception handling to catch instead the abstract parent class,
XmlException; we want to handle ALL types of invalid XML documents and direct the user to repair it themselves.