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

nbbrd.io.http.HttpResponseException Maven / Gradle / Ivy

The newest version!
package nbbrd.io.http;

import lombok.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;

import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Map;

@lombok.Getter
public final class HttpResponseException extends IOException {

    private final int responseCode;
    private final String responseMessage;
    private final Map> headerFields;

    public HttpResponseException(int responseCode, @Nullable String responseMessage) {
        this(responseCode, responseMessage, Collections.emptyMap());
    }

    public HttpResponseException(int responseCode, @Nullable String responseMessage, @NonNull Map> headerFields) {
        super(responseCode + ": " + responseMessage);
        this.responseCode = responseCode;
        this.responseMessage = responseMessage;
        this.headerFields = headerFields;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy