Examples of GeoIp2Exception


Examples of com.maxmind.geoip2.exception.GeoIp2Exception

                false);

        try {
            return mapper.reader(cls).with(inject).readValue(body);
        } catch (IOException e) {
            throw new GeoIp2Exception(
                    "Received a 200 response but not decode it as JSON: "
                            + body);
        }
    }
View Full Code Here

Examples of com.maxmind.geoip2.exception.GeoIp2Exception

        HttpRequestFactory requestFactory = transport.createRequestFactory();
        HttpRequest request;
        try {
            request = requestFactory.buildGetRequest(uri);
        } catch (IOException e) {
            throw new GeoIp2Exception("Error building request", e);
        }
        request.setConnectTimeout(this.connectTimeout);
        request.setReadTimeout(this.readTimeout);

        HttpHeaders headers = request.getHeaders();
View Full Code Here

Examples of com.maxmind.geoip2.exception.GeoIp2Exception

            throws GeoIp2Exception {
        String body;
        try {
            body = response.parseAsString();
        } catch (IOException e) {
            throw new GeoIp2Exception(
                    "Received a 200 response but not decode message body: "
                            + e.getMessage());
        }

        if (response.getContentType() == null
                || !response.getContentType().contains("json")) {
            throw new GeoIp2Exception("Received a 200 response for " + uri
                    + " but it does not appear to be JSON:\n" + body);
        }
        return body;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.