问题描述:

I am using Request class in org.apache.http.client.fluent to post some data from one webserver to another webserver. When a network failure occurs, I want to know if the network error happened when posting the data or when waiting for a response from the server. If I catch java.net.SocketException, it catches all network exceptions. Is there a sub class that catches only request side network exceptions?

pseudo code for what I am trying to do

try

{

Request.Post(address);

}

catch(RequestNetworkException ex)

{

//come here only if the network error happens before data reaches the server

doSomething();

}

相关阅读:
Top