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 polaris-all Show documentation
Show all versions of polaris-all Show documentation
All in one project for polaris-java
The newest version!
package com.ecwid.consul.v1;
import com.ecwid.consul.ConsulException;
import com.ecwid.consul.transport.HttpResponse;
/**
* @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(HttpResponse httpResponse) {
this(httpResponse.getStatusCode(), httpResponse.getStatusMessage(), httpResponse.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 - 2025 Weber Informatics LLC | Privacy Policy