Comments (10)
Hard to tell what is going on. Can you post the full stack trace of the StateError
, or a reproducible minimal example?
from dart-xml.
Here is stack trace:
I/flutter ( 7708): StateError is thrown
I/chatty ( 7708): uid=10146(com.example.part1) 1.ui identical 7 lines
I/flutter ( 7708): StateError is thrown
I/flutter ( 7708): itunesImage | https://image.simplecastcdn.com/images/8862bce3-8814-46a6-9b72-a533960bbd50/5dd1869a-dac7-4edc-acb6-f791663f6fd1/3000x3000/wim176-frisby-ep-01-v001.jpg?aid=rss_feed
from dart-xml.
I just added a finally after the StateError {} and it is showing in stack trace the expected itunesImage value. And then showing the initial value I declared in the begin of the factory. I have to create a minimal viable project for you that demos this behavior. Should have this for you within 24 hours.
from dart-xml.
I'd like to see where the full stack of where the StateError
is thrown, not where it is handled :-)
from dart-xml.
I don't know how to do that. I took the time to make a MVP, it is 280MB, tried to paste it here and got file too big error. How do I get this to you?
from dart-xml.
Ok, just discovered on StateError catch (e, s)
is this what you want?
I/flutter ( 7161): Unknown exceptions: Bad state: No element, with stack:
I/flutter ( 7161): #0 Iterable.first (dart:core/iterable.dart:624:7)
I/flutter ( 7161): #1 new RssItem.parse (package:fake_throw/models/rss_item.dart:21:75)
I/flutter ( 7161): #2 new RssFeed.parse. (package:fake_throw/models/rss_feed.dart:26:43)
I/flutter ( 7161): #3 MappedIterator.moveNext (dart:_internal/iterable.dart:391:20)
I/flutter ( 7161): #4 new List.from (dart:core-patch/array_patch.dart:41:17)
I/flutter ( 7161): #5 new RssFeed.parse (package:fake_throw/models/rss_feed.dart:24:17)
I/flutter ( 7161): #6 RssParser.loadAsset (package:fake_throw/services/rss_parser.dart:12:13)
I/flutter ( 7161):
I/flutter ( 7161): #7 RssFeedLogic.rssFeed (package:fake_throw/rss_feed_logic.dart:12:25)
I/flutter ( 7161):
I/chatty ( 7161): uid=10146(com.example.fake_throw) 1.ui identical 7 lines
I/flutter ( 7161): Unknown exceptions: Bad state: No element, with stack:
I/flutter ( 7161): #0 Iterable.first (dart:core/iterable.dart:624:7)
I/flutter ( 7161): #1 new RssItem.parse (package:fake_throw/models/rss_item.dart:21:75)
I/flutter ( 7161): #2 new RssFeed.parse. (package:fake_throw/models/rss_feed.dart:26:43)
I/flutter ( 7161): #3 MappedIterator.moveNext (dart:_internal/iterable.dart:391:20)
I/flutter ( 7161): #4 new List.from (dart:core-patch/array_patch.dart:41:17)
I/flutter ( 7161): #5 new RssFeed.parse (package:fake_throw/models/rss_feed.dart:24:17)
I/flutter ( 7161): #6 RssParser.loadAsset (package:fake_throw/services/rss_parser.dart:12:13)
I/flutter ( 7161):
I/flutter ( 7161): #7 RssFeedLogic.rssFeed (package:fake_throw/rss_feed_logic.dart:12:25)
I/flutter ( 7161):
from dart-xml.
Yes, perfect: Looks like RssItem.parse
calls first
on an empty collection (package:fake_throw/models/rss_item.dart:21:75). Look for the bug there ...
from dart-xml.
Upon, further investigation this issue shows itself for a specific RSS feed. Tested 6 feeds and it's only the one. That bad one validated as proper XML, too. I though it was related to the string query on the end of the url, but it's not. I will just need to work around this. Dart XML extracts all the values and throws. So I still get the values I need.
from dart-xml.
Ok, your Dart XML package is solid, doing exactly what it should be doing. The RSS feed that was giving me problems has items where the iTunes:image element is missing. The file is close to 4k lines long and they don't go missing till near the very end.
from dart-xml.
Sorry for bothering you with this non-existent issue.
from dart-xml.
Related Issues (20)
- Parsing into a concrete syntax tree. HOT 2
- .toXmlString(pretty: true) should not replace \r\n with spaces HOT 2
- Questions about event-drive api HOT 6
- Single `XmlText` is split into two `XmlTextEvent` HOT 2
- Builder is appending duplicate attributes instead of overwriting the existing one. HOT 1
- XmlElement.setAttribute can create duplicate attribute if the name contains a colon HOT 3
- Dependency issues HOT 3
- Flutter error : 'XmlText' isn't a type. HOT 1
- 2.11 End-of-Line Handling HOT 3
- Parse file that does not have closing tags HOT 2
- How can I transform XML with XSL? HOT 3
- How to remove node from xml HOT 2
- How to omit xml declaration and remove indentation? HOT 3
- How to add new line before each attribute? HOT 1
- How to convert xml to string without backslahes HOT 2
- entityMapping: Works unexpectedly HOT 3
- New release with XPath support? HOT 3
- isSelfClosing not working HOT 5
- XmlParserException: ">" expected at 1:16 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dart-xml.