Package is.bokun.dtos

Examples of is.bokun.dtos.ApiResponse


     */
    protected void validateResponse(Response r) {
        if ( r.getStatusCode() != 200 ) {
            // try parsing an API response
            try {
                ApiResponse ar = json.readValue(r.getResponseBody("UTF-8"), ApiResponse.class);
                throw new RestServiceException(ar);
            } catch (Exception e) {
                ApiResponse ar = new ApiResponse(r.getStatusText());
                throw new RestServiceException(ar, e);
            }
        }
    }
View Full Code Here


     *
     * @param t the exception that occurred
     * @return a RestServiceException wrapping the original exception
     */
    protected RestServiceException wrapException(Throwable t) {
        ApiResponse ar = new ApiResponse(t.getMessage());
        return new RestServiceException(ar, t);
    }
View Full Code Here

TOP

Related Classes of is.bokun.dtos.ApiResponse

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.