com.devcycle.sdk.server.common.exception.DevCycleException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-server-sdk Show documentation
Show all versions of java-server-sdk Show documentation
Server side SDK to interact with DevCycle.
package com.devcycle.sdk.server.common.exception;
import com.devcycle.sdk.server.common.model.ErrorResponse;
import com.devcycle.sdk.server.common.model.HttpResponseCode;
import lombok.Getter;
@Getter
public class DevCycleException extends Exception {
private final HttpResponseCode httpResponseCode;
private final ErrorResponse errorResponse;
public DevCycleException(HttpResponseCode httpResponseCode, ErrorResponse errorResponse) {
super(errorResponse.getMessage());
this.httpResponseCode = httpResponseCode;
this.errorResponse = errorResponse;
}
public boolean isRetryable() {
return httpResponseCode.code() >= HttpResponseCode.SERVER_ERROR.code();
}
}