Error Categories
1. Protocol Errors
Transport/connection issues not related to AdCP business logic:- Network timeouts
- Connection refused
- TLS/SSL errors
- JSON parsing errors
2. Task Errors
Business logic failures returned asstatus: "failed":
- Insufficient inventory
- Invalid targeting
- Budget validation failures
- Resource not found
3. Validation Errors
Malformed requests that fail schema validation:- Missing required fields
- Invalid field types
- Out-of-range values
Error Response Format
Failed operations return statusfailed with error details at the top level:
Error Response Fields
Standard Error Codes
Authentication Errors
Validation Errors
Resource Errors
Operation Errors
Account Errors
Rate Limiting Errors
System Errors
Retry Logic
Exponential Backoff
Implement exponential backoff for retryable errors:Error Categorization
Use therecovery field to determine how to handle errors:
Rate Limit Handling
Error Handling Patterns
Basic Error Handler
User-Friendly Messages
Convert technical errors to user-friendly messages:Structured Error Logging
Log errors with context for debugging:Webhook Error Handling
Failed Webhook Delivery
When webhook delivery fails, fall back to polling:Webhook Handler Errors
Handle errors in your webhook endpoint gracefully:Recovery Strategies
Context Recovery
If context expires, start a new conversation:Partial Success Handling
Some operations may partially succeed:Best Practices
- Categorize errors - Different errors need different handling
- Implement retries - Use exponential backoff for transient errors
- Respect rate limits - Honor
retry_aftervalues - Log with context - Include relevant IDs for debugging
- User-friendly messages - Convert technical errors for users
- Fallback strategies - Always have a backup (e.g., polling for webhooks)
- Don’t retry permanent errors - Validation errors need code fixes
- Handle partial success - Process warnings in successful responses
Next Steps
- Task Lifecycle: See Task Lifecycle for status handling
- Webhooks: See Webhooks for webhook error handling
- Security: See Security for authentication errors