nbbrd.io.http.HttpResponseException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-io-http Show documentation
Show all versions of java-io-http Show documentation
Common IO utilities - http
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;
}
}