All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.tweeenveertig.openstack.exception.CommandException Maven / Gradle / Ivy

There is a newer version: 0.7.0
Show newest version
package nl.tweeenveertig.openstack.exception;

public class CommandException extends RuntimeException {

    private int httpStatusCode;
    private CommandExceptionError error;

    public CommandException(Integer httpStatusCode, CommandExceptionError error) {
        this.httpStatusCode = httpStatusCode;
        this.error = error;
    }

    public CommandException(String message) {
        super(message);
    }

    public CommandException(String message, Throwable rootCause) {
        super(message, rootCause);
    }

    public int getHttpStatusCode() {
        return this.httpStatusCode;
    }

    public CommandExceptionError getError() {
        return this.error;
    }

    public String toString() {
        return httpStatusCode != 0 && error != null ?
            "Command exception, HTTP Status code: "+httpStatusCode+" => " + error :
            super.toString();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy