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

jdash.client.exception.GDClientException Maven / Gradle / Ivy

The newest version!
package jdash.client.exception;

import jdash.client.GDClient;
import jdash.client.request.GDRequest;

import java.util.Objects;

/**
 * Emitted by {@link GDClient} methods when something goes wrong when executing a request. The cause is always available
 * via {@link GDClientException#getCause()}.
 */
public class GDClientException extends RuntimeException {

    private final GDRequest request;

    public GDClientException(GDRequest request, Throwable cause) {
        super("Error when processing request " + Objects.requireNonNull(request), cause);
        this.request = request;
    }

    /**
     * Gets the original request.
     *
     * @return the {@link GDRequest}
     */
    public GDRequest getRequest() {
        return request;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy