Package com.heroku.api.exception

Examples of com.heroku.api.exception.RequestFailedException


    @Override
    public List<StackInfo> getResponse(byte[] bytes, int status) {
        if (Http.Status.OK.equals(status)) {
            return parse(bytes, getClass());
        } else {
            throw new RequestFailedException("Unable to list stacks.", status, bytes);
        }
    }
View Full Code Here


    @Override
    public Unit getResponse(byte[] bytes, int status) {
        if (Http.Status.OK.equals(status)) {
            return Unit.unit;
        } else {
            throw new RequestFailedException("Unable to delete all keys.", status, bytes);
        }
    }
View Full Code Here

    public App getResponse(byte[] data, int code) {
        if (Http.Status.OK.equals(code)) {
            return parse(data, getClass());
        } else {
        }
        throw new RequestFailedException("Unable to get app appInfo", code, data);
    }
View Full Code Here

    @Override
    public String getResponse(byte[] bytes, int status) {
        if (Http.Status.OK.equals(status)) {
            return HttpUtil.getUTF8String(bytes);
        } else {
            throw new RequestFailedException("Unable to migrate stacks.", status, bytes);
        }
    }
View Full Code Here

    @Override
    public List<Addon> getResponse(byte[] bytes, int status) {
        if (status == Http.Status.OK.statusCode) {
            return parse(bytes, getClass());
        } else {
            throw new RequestFailedException("Unable to list addons.", status, bytes);
        }
    }
View Full Code Here

    @Override
    public App getResponse(byte[] bytes, int status) {
        if (status == Http.Status.OK.statusCode) {
            return parse(bytes, getClass());
        }
        throw new RequestFailedException("Unable to renameApp application.", status, bytes);
    }
View Full Code Here

            throw new RuntimeException("The URL was malformed: " + url, e);
        }
    }

    public static RequestFailedException insufficientPrivileges(int code, byte[] bytes) {
        return new RequestFailedException("Insufficient privileges.", code, bytes);
    }
View Full Code Here

    @Override
    public Unit getResponse(byte[] in, int code) {
        if (code == Http.Status.OK.statusCode)
            return Unit.unit;
        else
            throw new RequestFailedException("Config add failed", code, in);
    }
View Full Code Here

    @Override
    public Map<String, String> getResponse(byte[] bytes, int status) {
        if (status == Http.Status.OK.statusCode) {
            return parse(bytes, getClass());
        } else if (status == Http.Status.NOT_FOUND.statusCode) {
            throw new RequestFailedException("Application not found.", status, bytes);
        } else if (status == Http.Status.FORBIDDEN.statusCode) {
            throw new RequestFailedException(
                    "Insufficient privileges to \"" + config.get(Heroku.RequestKey.AppName) + "\"",
                    status,
                    bytes
            );
        } else {
            throw new RequestFailedException("Unable to list config failed.", status, bytes);
        }
    }
View Full Code Here

    @Override
    public Map<String, String> getResponse(byte[] bytes, int status) {
        if (status == Http.Status.OK.statusCode) {
            return parse(bytes, getClass());
        } else {
            throw new RequestFailedException("Config removal failed.", status, bytes);
        }
    }
View Full Code Here

TOP

Related Classes of com.heroku.api.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.