Package com.heroku.api.exception

Examples of com.heroku.api.exception.RequestFailedException


    @Override
    public Domain getResponse(byte[] bytes, int status) {
        if (Http.Status.CREATED.equals(status)) {
            return parse(bytes, getClass());
        } else {
            throw new RequestFailedException("Unable to add domain.", status, bytes);
        }
    }
View Full Code Here


    public RunResponse getResponse(byte[] bytes, int status) {
        if (status == 200) {
            Proc parsedProc = Json.parse(bytes, Proc.class);
            return new RunResponse(parsedProc);
        } else {
            throw new RequestFailedException("Run Request Failed,", status, bytes);
        }
    }
View Full Code Here

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

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

        if (status == Http.Status.OK.statusCode) {
            return Unit.unit;
        } else if (status == Http.Status.FORBIDDEN.statusCode) {
            throw HttpUtil.insufficientPrivileges(status, bytes);
        } else if (status == Http.Status.UNPROCESSABLE_ENTITY.statusCode) {
            throw new RequestFailedException("Invalid process type", status, bytes);
        } else if (status == Http.Status.PAYMENT_REQUIRED.statusCode) {
            throw new RequestFailedException("Payment is required for scaling this process. " +
                    "Please go to https://api.heroku.com and check your account details.", status, bytes);
        } else {
            throw new RequestFailedException("Error occurred while scaling.", 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 remove domain.", status, bytes);
        }
    }
View Full Code Here

        if (Http.Status.OK.equals(code)) {
            final Map<String, String> parsed = Json.parse(in, new TypeReference<Map<String, String>>() {}.getType());
            return Boolean.valueOf(parsed.get("maintenance"));
        }
        else
            throw new RequestFailedException("MaintenanceInfo failed", code, in);
    }
View Full Code Here

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

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

    @Override
    public User getResponse(byte[] bytes, int status) {
        if (status == Http.Status.OK.statusCode) {
            return parse(bytes, getClass());
        } else {
            throw new RequestFailedException("Unable to get user info.", 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.