Uncaught error when network connection is disrupted.
See original GitHub issueIntended outcome:
I’d like to be able to catch errors when a network connection is disrupted.
Actual outcome:
Errors generated when a network connection is disrupted result in an uncaught error: Uncaught (in promise) Error: undefined
How to reproduce the issue:
On a basic working example of an apollo app, disable the network connection in the browser or turn wifi off.
Versions
System:
OS: macOS 11.4
Binaries:
Node: 14.16.1 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 8.5.5 - /usr/local/bin/npm
Browsers:
Chrome: 101.0.4951.64
Firefox: 100.0.2
Safari: 14.1.1
npmPackages:
@apollo/client: ^3.6.4 => 3.6.4
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How To Fix “Your Connection Was Interrupted A Network ...
The fix applies to you if you have multiple connections. Please disconnect the connection that is giving you the error and connect to...
Read more >Top 8 Ways to Fix Your Connection Was Interrupted Error on ...
1. Restart Wi-Fi Router · 2. Flush DNS cache · 3. Reset Internet Protocol · 4. Clear Browsing Data · 5. Disable Proxy...
Read more >Uncaught Error: A network error - Stack Overflow
... I got an uncaught error: a network error (such as timeout, interrupted connection or unreachable host) has occurred.
Read more >Your connection was interrupted, A network change was ...
Your connection was interrupted · Check Wi-Fi router · Flush DNS cache · Reset Winsock · Check LAN settings · Check if any...
Read more >XPC connection interrupted | Apple Developer Forums
I need to load a dynamic library use xpc..this library need to display UI.Then console catch error : *** Terminating app due to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I encountered this issue too. I mocked a 500 error response for my API call.
I am wondering what’s the appropriate approach for handling this. it does not causes any issue on my functionality, just the error on ReactRefreshWebpackPlugin overlay is annoying me. I can catch the error where I invoke the query, but it makes me replicate the catch to everywhere I use query/mutation.
Was trying to create a custom link to prevent the error pass back since I already handled it on Error link. but it doesn’t work, since the Apollo client expects the result(error) back.
@jdgreenberger no updates as of yet. Our team is working on some higher priority things at the moment. Though we accept PRs so if you want to make an attempt to improve the error message here, we’d be happy to review the PR. Just let us know!