Skip to content

Conversation

@christopherfujino
Copy link
Contributor

@christopherfujino christopherfujino commented Jul 13, 2022

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.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jul 13, 2022
document = XmlDocument.parse(manifestFile.readAsStringSync());
} on XmlParserException {
return false;
} on XmlTagException {
Copy link
Contributor Author

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

Copy link
Contributor

@Jasguerrero Jasguerrero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@christopherfujino christopherfujino added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 13, 2022
@auto-submit auto-submit bot merged commit cadb264 into flutter:master Jul 13, 2022
@christopherfujino christopherfujino deleted the catch-xml-tag-exception branch July 13, 2022 23:42
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jul 14, 2022
christopherfujino added a commit to chris-forks/flutter that referenced this pull request Aug 2, 2022
camsim99 pushed a commit to camsim99/flutter that referenced this pull request Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flutter_tools] XmlTagException during flutter run

2 participants