vert-x/vert.x — pull request #333 by npahucki (2012-08-24 01:05:33+00:00)
Title: Send HttpClient connection errors to the appropriate request 

This partially addresses https://github.com/vert-x/vert.x/issues/325 that I entered. It allows each request to be notified when a connection fails to be made. The old behavior only notified the HttpClient, and never the request, so the request was just left hanging there, neither the handler with the HttpClientResponse being called, nor it's exceptionHandler in the event of a connection error.

If the HttpClient is to be reused, each request needs to be able to cleanup after itself, for example, aborting anything pending the request completing. This becomes very important when the HttpClient is being shared (for it's pooling ability) by several different code paths that need to act differently when a request can not complete.

If there is no exceptionHandler set on any particular request, the default behavior of notifying the HttpClient's exceptionHandler is maintained.

I have added an appropriate test, please make sure it makes sense since this is the first time working with the Vertx testing framework.

This fix is critical to a project my company is working on where a server is delegating incoming requests to other servers via HttpClient.

Thank you for your consideration.