I am trying to work with some legacy code and have come up against an issue when using volley.
I am trying to get to an api that our main site has and it works fine
I was able to catch this client-side when initializing the volley RequestQueue:
Volley.newRequestQueue(getApplicationContext(), new HurlStack() {
@Override
public HttpResponse performRequest(Request> request, Map additionalHeaders) {
try {
return super.performRequest(request, additionalHeaders);
} catch (AuthFailureError authFailureError) {
authFailureError.printStackTrace();
// Log out / whatever you need to do here
} catch (IOException e) {
e.printStackTrace();
if (e.getMessage().equals("No authentication challenges found")) {
// This is the error. You probably will want to handle any IOException, not just those with the same message.
}
}
return null;
}
});