Agent: handle socket errors while connecting to the proxy#11
Agent: handle socket errors while connecting to the proxy#11someone--else wants to merge 1 commit intomscdex:masterfrom someone--else:master
Conversation
…ed while connecting to the proxy are handled properly
|
I was just checking out It'd be great If this can be merged, or someone can provide a pointer to another solution. |
|
I agree It should be merged. It works for me too. |
|
I'm not sure this is the right approach. This PR seems to be passing a socket as "valid" whenever an error occurs. Is the point to allow the Agent implementation to be able to clean up the socket immediately after the error occurs? It seems like there may still be the possibility of the Agent to pass the socket out as valid for a short period of time? Also while on the topic, I'm thinking of ditching the copy of node's internal http.Agent code for the async |
|
seems to be related #19 |
|
Not sure if it's the right code to be merged with master, but it worked for me just fine. I was glad to be able to catch errors instead of application being dead. |
|
I also encountered this error and made a change in the library that reemitted the error in the request object:
This way, it allows Authentication Failed and other types of errors to be handled outside of the library. |
Passing client socket to the request on error allows it to be handled (vs aborting the process because of the unhandled exception)