How can I get the response code from a VolleyError? How can I get the response code from a VolleyError? android android

How can I get the response code from a VolleyError?


through the VolleyError:

error.networkResponse.statusCode

looking at the source code, I saw that VolleyError has a public final member NetworkResponse called networkResponse, that holds that statusCode of the Http call. You should check for NPE.

Here you can find the source code for the NetworkResponse. Here you can find the source code for the VolleyError