Error raised if someone goes offline and attempts a request
See original GitHub issueHi! I’m running into an issue where, if someone attempts a request while they are offline, result.headers
on line 40 blows up because err.response
is undefined
. I’m unsure of the proper way to go about fixing this, or if there is something I should be doing with the axios instance before passing it to axios-fetch to avoid this issue altogether.
Any help would be greatly appreciated!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
$http error handling: distinguishing user offline from other errors
So considering all of above, I have solved the problem using an offline directive which I am using to block user interaction if...
Read more >A Complete Guide and List of HTTP Status Codes
A complete list of HTTP status codes with explaination of what they are, why they occur and what you can do to fix...
Read more >What to do when you're booted offline while gaming
Getting “booted” is a common term for someone kicking you off an online game by attacking your internet connection.
Read more >Handling Failed HTTP Responses With fetch() - TJ VanToll
Basically fetch() will only reject a promise if the user is offline, or some unlikely networking error occurs, such a DNS lookup failure....
Read more >Python KeyError Exceptions and How to Handle Them
Python's official documentation says that the KeyError is raised when a mapping key is accessed and isn't found in the mapping. A mapping...
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
The simplest thing I can think of that might work is to change:
into
Is it possible for you to try a change like that and see if it fixes your problem?
Unless someone feels otherwise going to go ahead and close this issue. The proposed solution was implemented in https://github.com/lifeomic/axios-fetch/pull/78 and released in
@lifeomic/axios-fetch@2.0.2
https://github.com/lifeomic/axios-fetch/pull/79