Package org.jinstagram.entity.common

Examples of org.jinstagram.entity.common.InstagramErrorResponse


            throw handleInstagramError(response);
        }

    protected InstagramException handleInstagramError(Response response) throws InstagramException {
        Gson gson = new Gson();
        final InstagramErrorResponse error;
        try {
            if (response.getCode() == 400) {
                error = InstagramErrorResponse.parse(gson, response.getBody());
                error.setHeaders(response.getHeaders());
                error.throwException();
            }
            //sending too many requests too quickly;
            //limited to 5000 requests per hour per access_token or client_id overall.  (according to spec)
            else if (response.getCode() == 503) {
                error = InstagramErrorResponse.parse(gson, response.getBody());
                error.setHeaders(response.getHeaders());
                error.throwException();
            }
        } catch (JsonSyntaxException e) {
            throw new InstagramException("Failed to decode error response " + response.getBody(), e, response.getHeaders());
        }
        throw new InstagramException("Unknown error response code: " + response.getCode() + " " + response.getBody(), response.getHeaders());
View Full Code Here


    }

    private InstagramException handleInstagramError(Response response) throws InstagramException {
        if (response.getCode() == 400) {
            Gson gson = new Gson();
            final InstagramErrorResponse error = InstagramErrorResponse.parse(gson, response.getBody());
            error.setHeaders(response.getHeaders());
            error.throwException();
        }
        throw new InstagramException("Unknown error response code: " + response.getCode() + " " + response.getBody(), response.getHeaders());
    }
View Full Code Here

TOP

Related Classes of org.jinstagram.entity.common.InstagramErrorResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.