Skip to main content
All API errors raise TraciaError with a specific error code.

Basic Error Handling

Error Codes

Handling Specific Errors

Common Error Scenarios

Missing Variables

When running a prompt that requires variables you didn’t provide:

Provider Not Configured

When no LLM provider API key is configured:

Prompt Not Found

When requesting a prompt that doesn’t exist:

run_local() Errors

The run_local() method has additional error codes specific to local execution.

Missing Provider API Key

When no API key is found for the provider:
Solution: Set the environment variable or provide provider_api_key:

Unsupported Model

When using a custom model without specifying the provider:
Solution: Specify the provider explicitly:

Retry Logic

For transient errors like network issues or rate limits, implement retry logic: