Skip to main content

Overview

Errors are inevitable in distributed systems. Conversimple provides comprehensive error handling mechanisms to help you build reliable voice agents that gracefully recover from failures.

Error Types

Platform Errors

Errors originating from the Conversimple platform:

Tool Execution Errors

Errors from your tool functions:

AI Service Errors

Errors from STT/LLM/TTS providers:

Error Handling in Your Agent

Basic Error Handling

Implement the on_error callback:

Tool-Specific Error Handling

Handle errors within tools:

Async Tool Error Handling

For async tools:

Retry Strategies

Exponential Backoff

For transient errors:

Tool Retry Decorator

Create a reusable retry decorator:

Circuit Breaker Pattern

Prevent cascading failures:

Fallback Strategies

Default Responses

Provide fallback responses when tools fail:

Graceful Degradation

Reduce functionality instead of failing completely:

Logging and Monitoring

Structured Logging

Use structured logging for better debugging:

Error Metrics

Track error rates and patterns:

User-Friendly Error Messages

Return Helpful Messages

Provide clear, actionable error messages to users:

Next Steps

Logging & Monitoring

Set up comprehensive logging

Debugging

Advanced debugging techniques