Back to project page NetworkFacade.
The source code is released under:
Apache License
If you think the Android project NetworkFacade listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.saguinav.networkfacade; //from w w w. j a va2 s . c o m public class HttpError { public static enum Code { /** * Indicates that no connection could be established when performing a request. */ NO_CONNECTION, /** * Indicates that there was a network error when performing a request. */ NETWORK, /** * Indicates that the client seems to have errored. Server may return an error response. HttpCode 4XX. */ CLIENT, /** * Indicates that the server failed to fulfil an apparently valid request. HttpCode 5XX. */ SERVER, /** * Indicates that the connection or the socket timed out. */ TIME_OUT, /** * Indicates that the server's response could not be parsed because of the encoding. */ PARSE, UNKNOWN } private final Code code; private String message; private Throwable cause; public HttpError(Code code) { this.code = code; } public HttpError(Code code, String message) { this(code); this.message = message; } public HttpError(Code code, Throwable cause) { this(code); this.cause = cause; } public HttpError(Code code, String message, Throwable cause) { this(code, message); this.cause = cause; } public Code getCode() { return code; } public String getMessage() { return message; } public Throwable getCause() { return cause; } }