-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Propagate network errors through promise #6139
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
Comments
I don't think API change will be required, however there might be some extensive changes in the core files. Feel free to submit work-in-progress code and iterate in the PR, so you can receive earlier feedback on your effort. Can you also provide STR e.g. by modifying test server, so it will be possible to simulate an error you are referring to? |
I have a working version in my branch, but am having trouble getting Firefox to pass the new unit test I did a minor API change to Various tweaks were also added to the promise caching to allow for retries after failure. The test required a separate web server instance so I could simulate a network error (ie. cut the connection) without breaking other tests, so now exposes a way for the tests to instantiate and stop web servers. I'd very much appreciate any comments. I'll attempt to fix the unit test on Firefox, but it may take a while. |
@alt- At first glance I notice that you do not cache loop variables. Could you change, for instance, |
I managed to get the unit test to work on Firefox by rate limiting the web server. That should hopefully be it for this issue. |
I'm trying to catch transient network errors on range requests in
PDFDocmentProxy::getPage
, but they don't appear to propagate through the promise.I tracked it down to
ChunkedStreamManager::sendRequest
not attaching an error handler to theNetworkManager::requestRange
call.ChunkedStreamManager::onError
already exists, but doesn't appear to be used anywhere. Attaching it to the call triggers aUncaught (in promise) 0
on a network error, so there appears to be more plumbing necessary to propagate the error through the promise.I'd be happy to create a pull request if this seems like a logical path to follow, but I'm wondering if there are API changes required and would like a second opinion before starting.
The text was updated successfully, but these errors were encountered: