Package com.contentstack.sdk
Class Error
java.lang.Object
com.contentstack.sdk.Error
public class Error extends Object
If there is something wrong with the API request, Contentstack returns an error.
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description int
getErrorCode()
Returns error codeString
getErrorDetail()
Returns error in HashMap format where error is key and its respective information as HashMap's value.String
getErrorMessage()
Returns error in string format.protected void
setErrorCode(int errorCode)
protected void
setErrorDetail(String errDetails)
protected void
setErrorMessage(String errorMessage)
-
Constructor Details
-
Method Details
-
getErrorMessage
Returns error in string format.- Returns:
- String error message
Example :
String errorString = error.getErrorMessage();
-
setErrorMessage
-
getErrorCode
public int getErrorCode()Returns error code- Returns:
- int value.
Example :
int errorCode = error.getErrorCode();
-
setErrorCode
protected void setErrorCode(int errorCode) -
getErrorDetail
Returns error in HashMap format where error is key and its respective information as HashMap's value.- Returns:
- Map Error Hashmap
Example :
HashMap<String, Object> errorHashMap = error.getErrors();
-
setErrorDetail
-