Overview
Proper error handling is crucial for building reliable document processing applications. This guide covers all Pulse API error codes, retry strategies, and best practices for graceful error recovery.Error Response Format
All errors follow a consistent JSON structure:Error Categories
Authentication Errors
AUTH_XXX - API key issues
File Errors
FILE_XXX - File format/size issues
Request Errors
REQ_XXX - Invalid parameters
Job Errors
JOB_XXX - Async job issues
Billing Errors
BILLING_XXX - Usage limit issues
Server Errors
5XX - Internal server errors
Complete Error Code Reference
Authentication Errors
Code | Description | Solution |
---|---|---|
AUTH_001 | API key is required | Include x-api-key header in request |
AUTH_002 | Invalid API key | Verify key in Console |
AUTH_003 | API key expired | Generate new key in Console |
AUTH_004 | API key revoked | Contact support if unexpected |
File Errors
Code | Description | Solution |
---|---|---|
FILE_001 | Invalid file type | Use supported formats: PDF, JPG/JPEG, PNG, DOCX, PPTX, XLSX, HTML |
FILE_002 | File too large | Contact support for large files |
FILE_003 | File corrupted | Verify file integrity, re-save if needed |
FILE_004 | Empty file | Ensure file has content |
FILE_005 | Failed to download from URL | Check URL accessibility and permissions |
FILE_006 | Password-protected file | Provide password parameter |
Request Errors
Code | Description | Solution |
---|---|---|
REQ_001 | No file or URL provided | Include either file or file-url parameter |
REQ_002 | Both file and URL provided | Use only one input method |
REQ_003 | Invalid schema format | Validate JSON schema syntax |
REQ_004 | Schema too complex | Simplify nested structures |
REQ_005 | Invalid chunk size | Use chunk size between 100-10000 |
REQ_006 | Invalid page range | Check page numbers exist in document |
REQ_007 | Missing required parameter | Check API documentation for requirements |
Job Errors
Code | Description | Solution |
---|---|---|
JOB_001 | Job not found | Verify job ID is correct |
JOB_002 | Job already cancelled | Job cannot be modified |
JOB_003 | Job timeout | Retry with smaller document or pages |
JOB_004 | Job failed | Check error details for specific issue |
Billing Errors
Code | Description | Solution |
---|---|---|
BILLING_001 | Monthly page limit exceeded | Upgrade plan or wait for reset |
BILLING_002 | Payment method required | Add payment method in Console |
BILLING_003 | Subscription expired | Renew subscription |
Handling Errors in Code
Basic Error Handling
Comprehensive Error Handler
Retry Strategies
Exponential Backoff
Circuit Breaker Pattern
Intelligent Retry Logic
Error Recovery Patterns
Graceful Degradation
Partial Success Handling
Best Practices
Always Handle Errors
Always Handle Errors
- Never assume API calls will succeed
- Catch and handle specific error codes
- Provide meaningful error messages to users
- Log errors for debugging
Implement Retry Logic
Implement Retry Logic
- Use exponential backoff for transient errors
- Set reasonable retry limits
- Only retry retryable errors
- Add jitter to prevent thundering herd
Monitor Error Patterns
Monitor Error Patterns
- Track error frequencies
- Alert on error spikes
- Analyze patterns for optimization
- Review logs regularly
Graceful Degradation
Graceful Degradation
- Have fallback strategies
- Accept partial success
- Inform users of degraded functionality
- Queue for later retry if appropriate
Common Error Scenarios
Scenario 1: File Upload Issues
Scenario 2: Async Job Management
Next Steps
API Reference
See endpoint details