public class KontentError
extends java.lang.Object
implements java.io.Serializable
Kontent.ai returns standard HTTP status codes to indicate success or failure of a request. In general, codes in the 2xx range indicate a successful request, codes in the 4xx range indicate errors caused by an incorrect input (for example, providing incorrect API key), and codes in the 5xx range indicate an error on our side.
For troubleshooting failed requests, the Kontent.ai APIs provide error messages defined in a consumable format to help you identify and fix the issue. For example, when you request a content item that does not exist (e.g., you mistype its codename), the API returns a 404 HTTP error along with a JSON message.
If you cannot identify and resolve an issue with your API call, you can contact us with the response status and the unique error ID. Hint: use the chat button in the bottom right corner of this page.
| Constructor and Description |
|---|
KontentError() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canEqual(java.lang.Object other) |
boolean |
equals(java.lang.Object o) |
int |
getErrorCode()
Returns the HTTP error code returned by Kontent.ai.
|
java.lang.String |
getMessage()
Returns the error message provided by Kontent.ai detailing the error.
|
java.lang.String |
getRequestId()
Returns a unique ID that can be provided to Kontent.ai for support in relation to the error.
|
int |
getSpecificCode()
Returns the specific code returned by the Kontent.ai error response.
|
int |
hashCode() |
void |
setErrorCode(int errorCode)
Returns the HTTP error code returned by Kontent.ai.
|
void |
setMessage(java.lang.String message)
Returns the error message provided by Kontent.ai detailing the error.
|
void |
setRequestId(java.lang.String requestId)
Returns a unique ID that can be provided to Kontent.ai for support in relation to the error.
|
void |
setSpecificCode(int specificCode)
Returns the specific code returned by the Kontent.ai error response.
|
java.lang.String |
toString() |
public java.lang.String getMessage()
public java.lang.String getRequestId()
public int getErrorCode()
| 400 - Bad Request | The request was not understood. Check for a missing required parameter, or an invalid parameter value. |
| 401 - Unauthorized | The provided API key is invalid or missing. See
DeliveryClient(String, String). |
| 403 - Forbidden | The provided API key is invalid for the requested project. |
| 404 - Not Found | The requested resource doesn't exist. Try checking the resource name for typos. |
public int getSpecificCode()
public void setMessage(java.lang.String message)
message - Sets the message of this.public void setRequestId(java.lang.String requestId)
requestId - Sets the request ID of this.public void setErrorCode(int errorCode)
| 400 - Bad Request | The request was not understood. Check for a missing required parameter, or an invalid parameter value. |
| 401 - Unauthorized | The provided API key is invalid or missing. See
DeliveryClient(String, String). |
| 403 - Forbidden | The provided API key is invalid for the requested project. |
| 404 - Not Found | The requested resource doesn't exist. Try checking the resource name for typos. |
errorCode - Sets the errorCode of this.public void setSpecificCode(int specificCode)
specificCode - Sets the specific code of this.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectprotected boolean canEqual(java.lang.Object other)
public int hashCode()
hashCode in class java.lang.Object