io.harness.cf.client.connector.ConnectorException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ff-java-server-sdk Show documentation
Show all versions of ff-java-server-sdk Show documentation
Harness Feature Flag Java Server SDK
The newest version!
package io.harness.cf.client.connector;
public class ConnectorException extends Exception {
private final int httpCode;
private final boolean shouldRetry;
private final String httpReason;
public ConnectorException(String message) {
super(message);
this.httpCode = 0;
this.httpReason = "";
this.shouldRetry = true;
}
public ConnectorException(String message, int httpCode, String httpMsg) {
super(message);
this.httpCode = httpCode;
this.httpReason = httpMsg;
this.shouldRetry = true;
}
public ConnectorException(String message, int httpCode, String httpMsg, Exception e) {
super(message, e);
this.httpCode = httpCode;
this.httpReason = httpMsg;
this.shouldRetry = true;
}
public ConnectorException(String message, boolean shouldRetry, Exception e) {
super(message, e);
this.shouldRetry = shouldRetry;
this.httpCode = 0;
this.httpReason = "";
}
public boolean shouldRetry() {
return shouldRetry;
}
@Override
public String getMessage() {
final String httpInfo =
(httpCode == 0) ? "" : String.format(" - httpCode=%d httpReason=%s", httpCode, httpReason);
return super.getMessage() + httpInfo;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy