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

[Scheduler] Re-throw unhandled errors #19595

Merged
merged 1 commit into from
Aug 13, 2020

Commits on Aug 13, 2020

  1. [Scheduler] Re-throw unhandled errors

    Because `postTask` returns a promise, errors inside a `postTask`
    callback result in the promise being rejected.
    
    If we don't catch those errors, then the browser will report an
    "Unhandled promise rejection" error. This is a confusing message to see
    in the console, because the fact that `postTask` is a promise-based API
    is an implementation detail from the perspective of the developer.
    "Promise rejection" is a red herring.
    
    On the other hand, if we do catch those errors, then we need to report
    the error to the user in some other way.
    
    What we really want is the default error reporting behavior that a
    normal, non-Promise browser event gets.
    
    So, we'll re-throw inside `setTimeout`.
    acdlite committed Aug 13, 2020
    Configuration menu
    Copy the full SHA
    8cc7d97 View commit details
    Browse the repository at this point in the history