-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http.request can throw immediately but still connect a socket, cause unhandled error #26143
Comments
3 tasks
cjihrig
added a commit
to cjihrig/node
that referenced
this issue
Feb 26, 2019
Validate the timeout option in the ClientRequest() constructor to prevent asynchronously thrown validation errors. PR-URL: nodejs#26214 Fixes: nodejs#26143 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Wyatt Preul <wpreul@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
What was the cause of this fix, I am getting this error on http request.
|
Yes, I am also getting the same issue |
@kkmoslehpour @himanshupareek the error message says what the problem is: use |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A call to
http.request
can throw an error immediately but still connect a socket. When that socket is closed by the other party (e.g. due to timeout), I don't think there's a way to handle the socket hangup error without digging into thehttp.Agent
. Instead, it becomes an unhandled exception.An edge case, but still seems like a bug. Not sure if there are other ways to cause exceptions besides an invalid
timeout
type.output
The text was updated successfully, but these errors were encountered: