GithubHelp home page GithubHelp logo

Comments (2)

ide avatar ide commented on June 14, 2024

Thanks for the detailed report, it sounds like there are two issues at hand.

The first is that you don't have access to the actual Error object. Usually we'd expose it some way (ex: via an onLoadError prop) but in this specific case you can add error handling in your onLoadMoreAsync prop. The only other errors would be due to implementation bugs in InfiniteScrollView, which we expect not to exist but if they do (that's reality) we at least want to see them, hence the console.error call. So I don't think there's anything to change here.

The second problem is that console.error(error) prints out useless info because of how React Native serializes errors. My suggestion is to send a PR to React Native to make the console error logging more like V8's. The place to do that is here: https://github.com/facebook/react-native/blob/0dd93b62b4d1f6e570274eb7b3d7f5f557a3ea20/packager/react-packager/src/Resolver/polyfills/console.js#L379. That way all libraries and not just this one can fix the issue you reported.

from react-native-infinite-scroll-view.

benjaminbillet avatar benjaminbillet commented on June 14, 2024

The only other errors would be due to implementation bugs

For example, if I have some syntax error in renderLoadingErrorIndicator or in onLoadMoreAsync (e.g., something was not imported), the error will be catched by InfiniteScrollView, hiding any useful information regarding the actual error.

I agree that a better console.error logging would to the trick. Currently, I can see that the output log (react-native log-android/log-ios) displays correctly the error, thanks to the formatError function used in console.js. However, the red screen of death message is slightly different and does not include the result of formatError.

from react-native-infinite-scroll-view.

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.