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

com.contentstack.sdk.Error Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
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; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy