![JAR search and dependency download from the Maven repository](/logo.png)
mesosphere.client.common.HttpResponseException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of marathon-client Show documentation
Show all versions of marathon-client Show documentation
A Java API client for Mesosphere's Marathon.
package mesosphere.client.common;
import com.google.common.base.MoreObjects;
public abstract class HttpResponseException extends RuntimeException {
private int status;
private String message;
private final String methodKey;
private final String details;
protected HttpResponseException(int status, String message, String methodKey, String details) {
this.status = status;
this.message = message;
this.methodKey = methodKey;
this.details = details;
}
protected HttpResponseException(int status, String message) {
this.status = status;
this.message = message;
details = null;
methodKey = null;
}
/**
* Gets the HTTP status code of the failure, such as 404.
* @return status code of the HTTP response.
*/
public int getStatus() {
return status;
}
@Override
public String getMessage() {
return message + " (http status: " + status + ")";
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("Message", message)
.add("Status", status)
.add("Details", details)
.omitNullValues().toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy