com.ecwid.consul.v1.OperationException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of consul-api Show documentation
Show all versions of consul-api Show documentation
Java client for Consul HTTP API (http://consul.io)
package com.ecwid.consul.v1;
import com.ecwid.consul.ConsulException;
import com.ecwid.consul.transport.RawResponse;
/**
* @author Vasily Vasilkov ([email protected])
*/
public final class OperationException extends ConsulException {
private final int statusCode;
private final String statusMessage;
private final String statusContent;
public OperationException(int statusCode, String statusMessage, String statusContent) {
super("OperationException(statusCode=" + statusCode + ", statusMessage='" + statusMessage + "', statusContent='" + statusContent + "')");
this.statusCode = statusCode;
this.statusMessage = statusMessage;
this.statusContent = statusContent;
}
public OperationException(RawResponse rawResponse) {
this(rawResponse.getStatusCode(), rawResponse.getStatusMessage(), rawResponse.getContent());
}
public int getStatusCode() {
return statusCode;
}
public String getStatusMessage() {
return statusMessage;
}
public String getStatusContent() {
return statusContent;
}
@Override
public String toString() {
return "OperationException{" +
"statusCode=" + statusCode +
", statusMessage='" + statusMessage + '\'' +
", statusContent='" + statusContent + '\'' +
'}';
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy