All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.devcycle.sdk.server.common.exception.DevCycleException Maven / Gradle / Ivy

There is a newer version: 2.3.0
Show newest version
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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy