3
votes

In Node 0.4.2, is it possible for http.request() to return both through the callback and the error event? If, for example, a socket error occurs after the response body has been read?

2

2 Answers

1
votes

It is possible for http.request() to fire the error event after the response event has been fired, eg in the case that the server you are calling goes down while responding to your request.

0
votes

Could you clarify your question?

There does exist a generic catch-all error catcher:

http://nodejs.org/docs/v0.4.4/api/all.html#event_uncaughtException_

Remember to stop into #node.js and ask questions!