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

be.looorent.ponto.client.http.HttpClientException Maven / Gradle / Ivy

The newest version!
package be.looorent.ponto.client.http;

import java.net.URL;
import java.util.Collection;

import static java.util.Collections.emptyList;

public class HttpClientException extends RuntimeException {

    private final Collection errors;

    HttpClientException(Throwable cause) {
        super("An error occurred when calling Ponto's REST API", cause);
        this.errors = emptyList();
    }

    HttpClientException(URL url, int statusCode, HttpErrors errors) {
        super("Url: "+url+"; Response code: "+statusCode);
        this.errors = errors.getErrors();
    }

    public Collection getErrors() {
        return errors;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy