Android Open Source - NetworkFacade Http Error






From Project

Back to project page NetworkFacade.

License

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.

Java Source Code

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;
    }

}




Java Source Code List

com.android.volley.toolbox.AuthenticationChallengesProofHurlStack.java
com.saguinav.networkfacade.ApplicationTest.java
com.saguinav.networkfacade.HttpBody.java
com.saguinav.networkfacade.HttpClient.java
com.saguinav.networkfacade.HttpError.java
com.saguinav.networkfacade.HttpRequest.java
com.saguinav.networkfacade.RetryPolicy.java
com.saguinav.networkfacade.sample.HeadlessFragment.java
com.saguinav.networkfacade.sample.HttpClientSingleton.java
com.saguinav.networkfacade.sample.MainActivity.java
com.saguinav.networkfacade.sample.OkHttpApplication.java
com.saguinav.networkfacade.sample.OkHttpClient.java
com.saguinav.networkfacade.sample.RepositoriesDeserializer.java
com.saguinav.networkfacade.sample.Repository.java
com.saguinav.networkfacade.sample.SimpleURLBuilder.java
com.saguinav.networkfacade.sample.VolleyApplication.java
com.saguinav.networkfacade.sample.VolleyHttpClient.java