title: Handling response timeout in android using volley
body: <p>I am trying to catch basically two types of errors in android using volley. I have used errorListener for failed api calls. Below is what I am doing.</p>
  
  <pre><code>Response.ErrorListener errorListener = new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
  
              if(error instanceof NoConnectionError)
              {
                  // Did not connect
              }
              else if(error instanceof TimeoutError)
              {
               //Response Timeout error is what I have assumed.
              }
  
          }
      };
  </code></pre>
  
  <p>I am basically interested to distinguish between ConnectionTimeOut and ResponseTimeOut. Is this correct </p>
  
  <p>Edit:
  I need to make an API call for some validation and I am on 2G. The request is sent to the server but response is not received due to timeout. So I want to know if the request was delivered to server or the request was not at all sent to the server. From what I assume is if the client didn't connect to server it will be connectiontimeout error, else if the request is sent to the server and response is not obtained by the client then it would be timeout. So is my understanding is right or I am missing something?  </p>