- Leveraging our standardized error response model.
- Keeping your error-handling logic up-to-date to adapt to any API changes.
Error response model
Our APIs return a structured error object for all errors to simplify issue diagnosis. The format is as follows:code
: A unique, stable identifier for the error.title
: A brief summary of the issue.message
: Detailed guidance for resolving the error.
Field-level error details
For issues specific to individual fields, afields
object provides additional context.
Examples:
Best practices for handling API errors
1. Focus on error codes
- Error codes are stable and ideal for reliable handling logic.
- Map error codes to specific resolutions to ensure compatibility with API updates.
2. Log and inform
- Log errors for monitoring and troubleshooting.
- Provide clear, actionable feedback to users with suggestions for resolution.
3. Stay updated
- Regularly review error code documentation to align with new or updated conditions.
- Keep error-handling logic adaptable to future changes.