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

com.belladati.sdk.exception.server.UnexpectedResponseException Maven / Gradle / Ivy

Go to download

The BellaDati SDK allows accessing a BellaDati server from 3rd-party applications using Java. This project contains the SDK's interface definitions.

There is a newer version: 0.9.15.1
Show newest version
package com.belladati.sdk.exception.server;

/**
 * Indicates an unexpected response from the server, typically a HTTP 4xx or 5xx
 * error. This particular exception occurs if no other exception matches the
 * error returned by the server.
 * 
 * @author Chris Hennigfeld
 */
public class UnexpectedResponseException extends ServerResponseException {

	private final int responseCode;
	private final String responseContent;

	/** The serialVersionUID */
	private static final long serialVersionUID = -6829113009769255929L;

	public UnexpectedResponseException(int responseCode, String responseContent, Throwable cause) {
		super("Unexpected response with code " + responseCode + ": " + responseContent, cause);
		this.responseCode = responseCode;
		this.responseContent = responseContent;
	}

	public UnexpectedResponseException(int responseCode, String responseContent) {
		super("Unexpected response with code " + responseCode + ": " + responseContent);
		this.responseCode = responseCode;
		this.responseContent = responseContent;
	}

	/**
	 * Returns the response code received by the server.
	 * 
	 * @return the response code received by the server
	 */
	public int getResponseCode() {
		return responseCode;
	}

	/**
	 * Returns the response content received by the server.
	 * 
	 * @return the response content received by the server
	 */
	public String getResponseContent() {
		return responseContent;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy