OK, I've updated the pull request with a better approach. Now we don't buffer 
the error stream by default, and just pass the open stream to the error 
handler. It is up to it to close the stream, but after its execution we'll try 
to close it again (but won't fail if already closed or an exception is thrown 
while trying to close it).

This way we pass an open stream tot he error handlers and make sure it is 
always closed when needed.

My only doubt now is if just calling `close()` on the HTTP stream is enough or 
we'd better consume all the content before with some helper method such as 
`Strings2.toStringAndClose` or similar.

@andrewgaul is it safe to just close the stream? And, can you give another try 
to the tests with the new approach? Thanks for your feedback!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/700#issuecomment-77967865

Reply via email to