Request library uses this method in case of error/failure scenario during a request operation.
public class Activity implements INetListener { ... public void onError(IRequest arg0, IResponse arg1, IRequestStateElement arg2) {
arg1.getStatusLine().toString()
arg2.getErrorCode()); } ...}
The listener registered for the request receives the request object, the HttpResponse object which contains the details about the server response, and a RequestStateElement object which provides more details about the occurred error. In case, the error occurs before sending any request to the server, the HttpResponse object will be null.