Package com.cribbstechnologies.clients.mandrill.exception

Examples of com.cribbstechnologies.clients.mandrill.exception.RequestFailedException


            }

            String responseString = sb.toString();
            EntityUtils.consume(response.getEntity());
            if (response.getStatusLine().getStatusCode() != 200) {
                throw new RequestFailedException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode() + " " + responseString);
            }

            // for whatever reason the ping response isn't well-formed
            if (ServiceMethods.Users.PING.equals(serviceMethod) && responseString.indexOf("PONG!") > -1) {
                return new BaseMandrillStringResponse(responseString);
            }

            if (reference == null) {
                return convertResponseData(responseString, responseClass);
            } else {
                return convertAnonymousListResponseData(responseString, responseClass, reference);
            }
        } catch (MalformedURLException mURLE) {
            throw new RequestFailedException("Malformed url", mURLE);
        } catch (JsonGenerationException jge) {
            throw new RequestFailedException("Json Generation Exception", jge);
        } catch (JsonMappingException jme) {
            throw new RequestFailedException("Json Mapping Exception", jme);
        } catch (IOException ioe) {
            throw new RequestFailedException("IOException", ioe);
        }
    }
View Full Code Here

TOP

Related Classes of com.cribbstechnologies.clients.mandrill.exception.RequestFailedException

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.