Coder Social home page Coder Social logo

Comments (10)

renggli avatar renggli commented on August 17, 2024

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.

DavidBucienski avatar DavidBucienski commented on August 17, 2024

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.

DavidBucienski avatar DavidBucienski commented on August 17, 2024

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.

renggli avatar renggli commented on August 17, 2024

I'd like to see where the full stack of where the StateError is thrown, not where it is handled :-)

from dart-xml.

DavidBucienski avatar DavidBucienski commented on August 17, 2024

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.

DavidBucienski avatar DavidBucienski commented on August 17, 2024

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.

renggli avatar renggli commented on August 17, 2024

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.

DavidBucienski avatar DavidBucienski commented on August 17, 2024

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.

DavidBucienski avatar DavidBucienski commented on August 17, 2024

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.

DavidBucienski avatar DavidBucienski commented on August 17, 2024

Sorry for bothering you with this non-existent issue.

from dart-xml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.