@Override
public void onResult(final int responseCode, final String responseMessage, final @Nullable InputStream inputStream) {
if(responseCode != 200 || inputStream==null){
- if(responseCode != 204)
+ if(responseCode != 204 && responseCode != 504)
throw new RuntimeException("Bad HTTP response code: "+responseCode);
return;
}
@Override
public void onError(final String error) {
- Log.e("PollResultCallback", "onError: "+error);
- throw new RuntimeException(error);
+ //error handling is done by the LongPollRunnable thread
}
}