cloud/src/main/java/com/adamg/materialtemplate/cloud/network/error/CloudErrorHandler.java
private void handleHttpError(final RetrofitError error) {
        final Response response = error.getResponse();

        // Ensure a non-null response
        if (response != null) {
            // Pull out the response code
            final int status = response.getStatus();
            Log.e(TAG, "Http Error Status: " + status);

            // Switch on the status code
            switch (status) {
                case HttpStatus.SC_UNAUTHORIZED:
                case HttpStatus.SC_NOT_FOUND:
                    handleAuthError(error);
                    break;

                case HttpStatus.SC_CONFLICT:
                case HttpStatus.SC_FORBIDDEN:
                case HttpStatus.SC_LENGTH_REQUIRED:
                case HttpStatus.SC_LOCKED:
                case HttpStatus.SC_METHOD_FAILURE:
                case HttpStatus.SC_METHOD_NOT_ALLOWED:

                    // FIXME add more cases?

                default:
                    // Do nothing, let the other listeners handle it
            }
        }
    }
/**
     * Handles all of the non-200 level exceptions that are received from the server. First it will
     * switch on their http response level and if applicable on their application level response
     *
     * @param error the error that is thrown when the server reported an exception
     */
Handles all of the non-200 level exceptions that are received from the server. First it will
switch on their http response level and if applicable on their application level response

@param error the error that is thrown when the server reported an exception
Handles all of the non - 200 level exceptions that are received from the server . First it will switch on their http response level and if applicable on their application level response @param error the error that is thrown when the server reported an exception
private void handleHttpError(final RetrofitError error) {
        final Response response = error.getResponse();
        if (response != null) {
            final int status = response.getStatus();
            Log.e(TAG, "Http Error Status: " + status);
            switch (status) {
                case HttpStatus.SC_UNAUTHORIZED:
                case HttpStatus.SC_NOT_FOUND:
                    handleAuthError(error);
                    break;
                case HttpStatus.SC_CONFLICT:
                case HttpStatus.SC_FORBIDDEN:
                case HttpStatus.SC_LENGTH_REQUIRED:
                case HttpStatus.SC_LOCKED:
                case HttpStatus.SC_METHOD_FAILURE:
                case HttpStatus.SC_METHOD_NOT_ALLOWED:
                default:
            }
        }
    }
private void handleHttpError ( final RetrofitError error ) { final Response response = error . getResponse ( ) ; if ( response != null ) { final int status = response . getStatus ( ) ; Log . e ( TAG , "Http Error Status: " + status ) ; switch ( status ) { case HttpStatus . SC_UNAUTHORIZED : case HttpStatus . SC_NOT_FOUND : handleAuthError ( error ) ; break ; case HttpStatus . SC_CONFLICT : case HttpStatus . SC_FORBIDDEN : case HttpStatus . SC_LENGTH_REQUIRED : case HttpStatus . SC_LOCKED : case HttpStatus . SC_METHOD_FAILURE : case HttpStatus . SC_METHOD_NOT_ALLOWED : default : } } }
Handles all of the non-200 level exceptions that are received from the server.
Handles all of the non - 200 level exceptions that are received from the server .
// Ensure a non-null response // Pull out the response code // Switch on the status code // FIXME add more cases? // Do nothing, let the other listeners handle it