title: How to deal with unexpected response 500 in Android
body: <p>I am trying to retrieve a JSON from an external API using Volley.
  Here is my code</p>
  
  <pre><code> protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_test);
      final TextView mTextView = findViewById(R.id.testreq);
      RequestQueue queue = Volley.newRequestQueue(this);
      String url = "https://horoscope-free-api.herokuapp.com/?time=today&amp;sign=cancer";
      StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
              new Response.Listener&lt;String&gt;() {
                  @Override
                  public void onResponse(String response) {
                      // Display the first 500 characters of the response string.
                      mTextView.setText("Response is: "+ response.substring(0,500));
                  }
              }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
              mTextView.setText("That didn't work");
              Log.d("Error", error.toString());
          }
      });
      queue.add(stringRequest);
  }
  </code></pre>
  
  <p>It seems like the response is done but I am getting this error</p>
  
  <blockquote>
    <p>E/Volley: [277] BasicNetwork.performRequest: Unexpected response code 500
    and when I ran a test on the API in <a href="https://apitester.com/" rel="nofollow noreferrer">https://apitester.com/</a> It tells me its passed and I get this error </p>
  </blockquote>
  
  <p>Response Headers
  HTTP/1.1 500 Internal Server Error
  Connection: keep-alive
  Date: Sat, 10 Nov 2018 19:56:18 GMT
  Server: Apache
  Transfer-Encoding: chunked
  Content-Type: application/json
  Via: 1.1 vegur</p>
  
  <p>Any ideas how to solve this? Is it the API or is it me?</p>