timeout not cleared on error
See original GitHub issueSummary
When request is made and network error occurs, timeout is not cleared. It should be easy to replicate:
// disconnect from network before running
const axios = require('axios')
axios.get('http://github.com', { timeout: 1000 })
This script should fail and instantly quit but it will rather fail and hang for 1s
Context
- axios version: 0.18.0
- Environment: node
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
clearTimeout runs but it is not clearing the setTimeout
The execution enters the if-else condition but the clearTimeout doesn't seem to be working. The execution always refreshes the entire page ...
Read more >clearTimeout() - Web APIs - MDN Web Docs
The global clearTimeout() method cancels a timeout previously established by calling setTimeout().
Read more >Timer not clearing. How to properly use setTimeout ... - Reddit
I'm using React Native. I'm just trying to having a message change on the screen after 5 seconds. I understand that if the...
Read more >Test case is leaking async ops when using clearTimeout ...
If there is an error, the await delay(0) is skipped along with the post metrics, then it continues to the next test getting...
Read more >How does clearTimeout Works in JavaScript? - eduCBA
This will be the ID that was returned by the setTimeout() function. You can clear the timeout by using this id which identifies...
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
@JustinBeckwith I have the same issue The issue is that a request is completed in time but then the node process is hanging up during
timeout
before exiting. I suppose there is some issue with clearTimeout if an exception occurs (at least ENOTFOUND).Please re-open this issue.
I’ve simply disabled wifi on my macbook, maybe it is platform specific? Also, I had different error.