Skip to content
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

Suspend on uncaught error, if inside transition #23266

Closed
wants to merge 1 commit into from

Commits on Feb 10, 2022

  1. Suspend on uncaught error, if inside transition

    Usually, if an error isn't caught by an error boundary, we treat it
    like a panic: the whole app will unmount and we'll throw a
    top-level error.
    
    However, if we're in an async transition, what we can do instead is
    suspend the transition — i.e. remain on the current screen, like we do
    during a refresh when we're waiting for new data to load in
    the background.
    
    The reason we only do this for transitions is because synchronous
    renders are expected to commit synchronously to maintain consistency
    with external state. (We arguably should suspend-on-uncaught-error for
    non-sync concurrent renders like continuous inputs, too, but that merits
    further discussion.)
    
    The suspended error is logged with onRecoverableError.
    acdlite committed Feb 10, 2022
    Configuration menu
    Copy the full SHA
    39b49c8 View commit details
    Browse the repository at this point in the history