title: How to get response code from synchronous RequestFuture request
body: <p>I am using the strava API for an app. I am making synchronous requests as can be seen by the code below.</p>
  
  <pre><code> try {
              RequestQueue queue = Volley.newRequestQueue(context);
              RequestFuture&lt;String&gt; future = RequestFuture.newFuture();
              StringRequest request = new StringRequest(Request.Method.GET, urlRequest, future, future);
              queue.add(request);
  
              dataResponse = dealWithResponse(future.get()); 
  
          } catch (ExecutionException e) {
              System.err.println(e.getLocalizedMessage());
              System.err.println(e.getMessage());
              System.err.println(e.toString());
          } catch (java.lang.Exception e) {
              e.printStackTrace();
          }
  </code></pre>
  
  <p>I want to know how can I get the response code in the event of an error? for example some rides I request have been deleted / are private and i receive a 404 error code. Other times I have run out of API requests and get a code of 403. How can i differentiate between the thrown errors.</p>
  
  <p>Thank you very much for your help!</p>