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

com.github.alex1304.jdash.exception.BadResponseException Maven / Gradle / Ivy

There is a newer version: 3.3.10
Show newest version
package com.github.alex1304.jdash.exception;

import java.util.Objects;

import reactor.netty.http.client.HttpClientResponse;

/**
 * Thrown when the Geometry Dash API returns an HTTP error
 */
public final class BadResponseException extends GDClientException {
	private static final long serialVersionUID = -8098451293881609350L;
	
	private final HttpClientResponse response;
	
	public BadResponseException(HttpClientResponse response) {
		this.response = Objects.requireNonNull(response);
	}
	
	public HttpClientResponse getResponse() {
		return response;
	}

	@Override
	public String toString() {
		return response.status().codeAsText() + " " + response.status().reasonPhrase();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy