Package com.heroku.api.exception

Examples of com.heroku.api.exception.RequestFailedException


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


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

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

        if (status == 200) {
            try {
                URL logs = HttpUtil.toURL(new String(bytes));
                return new LogStreamResponse(logs);
            } catch (RuntimeException e) {
                throw new RequestFailedException(e.getMessage(), status, bytes);
            }
        } else {
            throw new RequestFailedException("Unable to get logs", status, bytes);
        }
    }
View Full Code Here

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

        if (code == 200) {
            return Json.parse(in, this.getClass());
        } else if (code == 404) {
            throw new LoginFailedException("Invalid username and password combination.", code, in);
        } else {
            throw new RequestFailedException("Unknown error occurred while connecting to Heroku.", code, in);
        }
    }
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("SharingTransfer failed", code, in);
    }
View Full Code Here

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

    @Override
    public App getResponse(byte[] in, int code) {
        if (code == Http.Status.ACCEPTED.statusCode)
            return parse(in, getClass());
        else
            throw new RequestFailedException("Failed to create app", code, in);
    }
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("SharingRemove failed", code, in);
    }
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.