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

com.eligible.exception.APIErrorResponseException Maven / Gradle / Ivy

There is a newer version: 1.13.13
Show newest version
package com.eligible.exception;

import com.eligible.model.APIErrorResponse;
import lombok.Getter;

/**
 * Internal API exception.
 */
public class APIErrorResponseException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    @Getter
    private final APIErrorResponse apiResponse;

    /**
     * Create APIErrorResponseException with message, requestId and cause.
     *
     * @param message message
     * @param apiResponse EligibleAPI response
     */
    public APIErrorResponseException(String message, APIErrorResponse apiResponse) {
        super(message);
        this.apiResponse = apiResponse;
    }

    /** {@inheritDoc} */
    public String toString() {
        String reqIdStr = "";
        if (apiResponse != null) {
            reqIdStr = "; apiResponse: " + apiResponse;
        }
        return super.toString() + reqIdStr;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy