
com.adyen.service.exception.ApiException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of adyen-java-api-library Show documentation
Show all versions of adyen-java-api-library Show documentation
Adyen API Client Library for Java
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Java API Library
*
* Copyright (c) 2017 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
package com.adyen.service.exception;
import java.util.List;
import java.util.Map;
import com.adyen.model.ApiError;
/**
* API Exception thrown when there is an API error
*
* Check ApiError object to obtain the information about the error
*/
public class ApiException extends Exception {
// Object with the information about the error
private ApiError error;
// HTTP status code
private int statusCode;
private Map> responseHeaders;
// error JSON response
private String responseBody;
public ApiException(String message, int statusCode) {
super(message);
this.statusCode = statusCode;
}
public ApiException(String message, int statusCode, Map> responseHeaders) {
this(message, statusCode);
this.responseHeaders = responseHeaders;
}
public ApiError getError() {
return error;
}
public void setError(ApiError error) {
this.error = error;
}
public int getStatusCode() {
return statusCode;
}
public void setStatusCode(int statusCode) {
this.statusCode = statusCode;
}
public Map> getResponseHeaders() {
return responseHeaders;
}
public String getResponseBody() {
return responseBody;
}
public void setResponseBody(String responseBody) {
this.responseBody = responseBody;
}
@Override
public String toString() {
return "ApiException{" + "error=" + error +
", statusCode=" + statusCode +
", message=" + getMessage() +
", responseHeaders=" + getResponseHeaders() +
", responseBody=" + getResponseBody() + "}";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy