Error Handling
Handle API errors with typed exceptions, stream error events, and built-in retry logic.
Error Types
from amigo_sdk.errors import (
AmigoError, # Base error class
AuthenticationError, # Invalid credentials (401)
ForbiddenError, # Permission denied (403)
NotFoundError, # Resource not found (404)
BadRequestError, # Invalid request (400)
ValidationError, # Request validation failed (422)
ConflictError, # Resource conflict (409)
RateLimitError, # Rate limit (429)
ServerError, # Server error (5xx)
ServiceUnavailableError, # Service unavailable (503)
)import {
AmigoError, // Base error class
AuthenticationError, // Invalid credentials (401)
PermissionError, // Permission denied (403)
NotFoundError, // Resource not found (404)
BadRequestError, // Invalid request (400)
ValidationError, // Request validation failed (422)
ConflictError, // Resource conflict (409)
RateLimitError, // Rate limit (429)
ServerError, // Server error (5xx)
ServiceUnavailableError, // Service unavailable (503)
NetworkError, // Network/connection failures
} from '@amigo-ai/sdk'Basic Error Handling
Stream Error Handling
Built-in Retry Logic
Setting
Default
Retry Flow Diagram
Best Practices
Next Steps
Last updated
Was this helpful?

