The VolleyError object has a networkResponse reference, try to check it to see if you can get some useful information from there.
@Override
public void onErrorResponse(VolleyError error) {
if (error == null || error.networkResponse == null) {
return;
}
String body;
//get status code here
final String statusCode = String.valueOf(error.networkResponse.statusCode);
//get response body and parse with appropriate encoding
try {
body = new String(error.networkResponse.data,"UTF-8");
} catch (UnsupportedEncodingException e) {
// exception
}
//do stuff with the body...
}
0 comments:
Post a Comment