Error Handling
Disguise Cloud API provides a consistent error response structure to help you handle errors effectively. All errors will have the following return structure:
{
"error": {
"message": "Example message",
"details": "Example details providing further context"
}
}
Error Response Structure
The error response contains two main fields:
- message: A brief description of the error.
- details: Additional information about the error.
In addition, you will receive standard HTTP status codes to indicate the type of error that occurred as per RESTful API conventions.
Common Errors
Here are some common errors you might encounter while using the Cloud API:
- 404 Not Found: The requested resource could not be found.
- 401 Unauthorized: Authentication is required and has failed or has not yet been provided.
- 429 Too Many Requests: You have exceeded the rate limit. Please see the Rate Limits section for more information.
To see all status codes the API uses, please refer to Status Codes.
Handling Errors
To handle errors effectively, you should:
- Check the
messageanddetailsfields in the error response to understand the cause of the error. - Implement appropriate error handling in your code based on the error type.
- Contact support if you encounter an error that you cannot resolve.
By following these guidelines, you can ensure that your applications handle errors gracefully and maintain smooth interaction with the Disguise Cloud API.