`request.abort()` throws again after `request.destroy(error)`
See original GitHub issueWhat is the expected behavior?
destroy error
What is the actual behavior?
destroy error
socket hang up
Possible solution
Don’t throw if the request has been destroyed already.
How to reproduce the issue
https://runkit.com/szmarczak/5ea0a014d6a6c7001305c163
Does the bug have a test case?
Haven’t checked.
Versions
Software | Version(s) |
---|---|
Nock | 12.0.3 |
Node | v13.13.0 |
TypeScript | - |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
nodejs: abort http reply while in progress - Stack Overflow
How to abort connection on sender side when it's known that request cannot be fulfilled? One way I found out is to throw...
Read more >HTTP | Node.js v19.3.0 Documentation
Emitted when the request has been aborted by the client. This event is only emitted on the first call to abort() . Event:...
Read more >HTTP status and error codes for JSON | Cloud Storage
This error will occur if access to said domain occurs after the domain expires. Issue the original request again, and receive a new...
Read more >ThreadAbortException Class (System.Threading)
When a call is made to the Abort method to destroy a thread, the common language runtime throws a ThreadAbortException on .NET Framework....
Read more >AWS SDK for JavaScript v3
send(new CreateBucketCommand(commandParams), { abortSignal: abortController.signal, }); // The abortController can be aborted any time. // The request will not ...
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 Free
Top 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
Indeed. I’ll close this issue.
@szmarczak note that on Node.js 14 behavior is different. First destroy wins, so it’s “socket hang up” not “destroy error”.