public class ErrorHandler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ERROR_DETAIL |
private static java.lang.String |
TAG |
Constructor and Description |
---|
ErrorHandler() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getMessage(VolleyError error,
Context context)
Method returning the error message
|
static int |
networkResponseError(VolleyError error,
Context context)
Method for handling network errors
|
private static java.lang.String |
trimMessage(java.lang.String errorResponse,
java.lang.String key)
Method extracting the message from the volley status code
|
private static final java.lang.String TAG
private static final java.lang.String ERROR_DETAIL
public static int networkResponseError(VolleyError error, Context context)
error
- - Volley error responsecontext
- - application contextprivate static java.lang.String trimMessage(java.lang.String errorResponse, java.lang.String key)
errorResponse
- - string error responsekey
- - key for the error objectpublic static java.lang.String getMessage(VolleyError error, Context context)
error
- - volley response errorcontext
- - application context