com.gocardless.errors.GoCardlessApiException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gocardless-pro Show documentation
Show all versions of gocardless-pro Show documentation
Client library for accessing the GoCardless Pro API
package com.gocardless.errors;
import com.gocardless.GoCardlessException;
import java.util.List;
/**
* Base class for exceptions that are thrown as a result of error responses from the API.
*/
public class GoCardlessApiException extends GoCardlessException {
private final ApiErrorResponse error;
GoCardlessApiException(ApiErrorResponse error) {
super(error.toString());
this.error = error;
}
/**
* Returns a human-readable description of the error.
*/
public String getErrorMessage() {
return error.getMessage();
}
/**
* Returns the type of the error.
*/
public ErrorType getType() {
return error.getType();
}
/**
* Returns the URL to the documentation describing the error.
*/
public String getDocumentationUrl() {
return error.getDocumentationUrl();
}
/**
* Returns the ID of the request. This can be used to help the support team find your error
* quickly.
*/
public String getRequestId() {
return error.getRequestId();
}
/**
* Returns the HTTP status code.
*/
public int getCode() {
return error.getCode();
}
/**
* Returns a list of errors.
*/
public List getErrors() {
return error.getErrors();
}
@Override
public String toString() {
return error.toString();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy