question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`request.abort()` throws again after `request.destroy(error)`

See original GitHub issue

What 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
szmarczakcommented, Apr 26, 2020

Indeed. I’ll close this issue.

1reaction
lpincacommented, Apr 26, 2020

@szmarczak note that on Node.js 14 behavior is different. First destroy wins, so it’s “socket hang up” not “destroy error”.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found