com.contentstack.sdk.Error Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java Show documentation
Show all versions of java Show documentation
Java SDK for Contentstack Content Delivery API
package com.contentstack.sdk;
/**
* If there is something wrong with the API request, Contentstack returns an error.
*/
public class Error {
String errorMessage = null;
int errorCode = 0;
String errDetails = null;
public Error() {
}
public Error(String errorMessage, int errorCode, String errDetails) {
this.errorMessage = errorMessage;
this.errorCode = errorCode;
this.errDetails = errDetails;
}
/**
* Returns error in string format.
*
* @return String error message
*
* Example :
*
*
* String errorString = error.getErrorMessage();
*
*/
public String getErrorMessage() {
return errorMessage;
}
protected void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
/**
* Returns error code
*
* @return int value.
*
* Example :
*
*
* int errorCode = error.getErrorCode();
*
*/
public int getErrorCode() {
return errorCode;
}
protected void setErrorCode(int errorCode) {
this.errorCode = errorCode;
}
/**
* Returns error details in {@linkplain String}
*
* @return String
*
* Example :
*
*
* String error = error.getErrorDetail();
*
*/
public String getErrorDetail() {
return this.errDetails;
}
protected void setErrorDetail(String errDetails) {
this.errDetails = errDetails;
}
}