Skip to main content

Error Handling

This guide covers error handling strategies, common error types, and best practices for building resilient applications with the Blue Oyster API.

Error Response Format

All API errors follow this standard format:

HTTP Status Codes

Common Error Codes

API Errors

TOOL_EXECUTION_FAILED
string
Tool execution encountered an error. Check tool parameters and external service status.
MEMORY_NOT_INITIALIZED
string
MongoDB memory system not configured. Thread persistence unavailable.
INVALID_REQUEST
string
Request body malformed or missing required parameters.
RATE_LIMITED
string
Too many requests. Implement exponential backoff.
MODEL_ERROR
string
AI model processing failed. May be temporary.

Speech-to-Text Errors

AUDIO_PROCESSING_ERROR
string
Audio file processing failed. Check file format and size.
INVALID_AUDIO_FORMAT
string
Audio file format not supported.
AUDIO_TOO_LARGE
string
Audio file exceeds size limit (25MB).

Error Handling Strategies

Basic Error Handling

Exponential Backoff

Circuit Breaker Pattern

Comprehensive Error Handler

Error Monitoring

Error Tracking

Best Practices

Always implement error boundaries in your UI to prevent crashes.
Provide user-friendly error messages instead of raw API errors.
Implement graceful degradation when services are unavailable.
Log errors for debugging but don’t expose sensitive information.
Use exponential backoff for retry logic to avoid overwhelming services.
Monitor error rates and implement circuit breakers for resilience.