Package com.heroku.api.exception

Examples of com.heroku.api.exception.HerokuAPIException


            BufferedReader reader = new BufferedReader(ireader);
            /*this line reads the string "rendezvous" */
            reader.readLine();
            return in;
        } catch (IOException e) {
            throw new HerokuAPIException("IOException while running process", e);
        }
    }
View Full Code Here


            }
            urlConnection.connect();
            return urlConnection.getInputStream();

        } catch (IOException e) {
            throw new HerokuAPIException("IOException while opening log stream", e);
        }
    }
View Full Code Here

Likewise, the secure random parameter may be null in which case the default implementation will be used.
            */
            ctx.init(null, tmgrs, null);
            return ctx;
        } catch (NoSuchAlgorithmException e) {
            throw new HerokuAPIException("NoSuchAlgorithmException while trying to setup SSLContext", e);
        } catch (KeyManagementException e) {
            throw new HerokuAPIException("KeyManagementException while trying to setup SSLContext", e);
        }
    }
View Full Code Here

    @Override
    public <T> T execute(Request<T> request, Map<String,String> extraHeaders,  String key) {
        try {
            return executeAsync(request, extraHeaders, key).get();
        } catch (InterruptedException e) {
            throw new HerokuAPIException(e);
        } catch (ExecutionException e) {
            throw new HerokuAPIException(e);
        }
    }
View Full Code Here

        }
        if (key != null) {
            try {
                builder.setHeader("Authorization", "Basic " + Base64.encode((":" + key).getBytes("UTF-8")));
            } catch (UnsupportedEncodingException e) {
                throw new HerokuAPIException("UnsupportedEncodingException while encoding api key", e);
            }
        }
        if (req.hasBody()) {
            builder.setBody(req.getBody());
        }
View Full Code Here

            }
        };
        try {
            return httpClient.executeRequest(asyncRequest, handler);
        } catch (IOException e) {
            throw new HerokuAPIException("IOException while executing request", e);
        }
    }
View Full Code Here

    @Override
    public <T> T execute(Request<T> req, Map<String,String> extraHeaders, String key) {
        try {
            return executeAsync(req, extraHeaders, key).get(30L, TimeUnit.SECONDS);
        } catch (InterruptedException e) {
            throw new HerokuAPIException("request interrupted", e);
        } catch (ExecutionException e) {
            if (e.getCause() != null && e.getCause().getCause() instanceof RequestFailedException) {
                throw (RequestFailedException) e.getCause().getCause();
            }
            throw new HerokuAPIException("execution exception", e.getCause());
        } catch (TimeoutException e) {
            throw new HerokuAPIException("request timeout after 30 sec", e.getCause());
        }
    }
View Full Code Here

            }
            wbc.close();
            rbc.close();
            return os.toByteArray();
        } catch (IOException e) {
            throw new HerokuAPIException("IOException while reading response", e);
        }
    }
View Full Code Here

    public static String getUTF8String(byte[] in) {
        try {
            return new String(in, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            throw new HerokuAPIException("Somehow UTF-8 is unsupported", e);
        }
    }
View Full Code Here

TOP

Related Classes of com.heroku.api.exception.HerokuAPIException

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.