This is the code i have currently:
if (status != HttpURLConnection.HTTP_FORBIDDEN && status != HttpURLConnection.HTTP_BAD