Expand description
Error types for the Anthropic API client.
This module provides error handling for the library, including:
AnthropicToolError- Main error type for all API errorsErrorResponse- API error response structureErrorDetail- Detailed error informationResult- Type alias forResult<T, AnthropicToolError>
§Error Types
The API can return various error types:
ApiKeyNotSet- Missing API keyInvalidRequestError- Malformed requestAuthenticationError- Invalid API keyRateLimitError- Too many requestsOverloadedError- Server overloaded
§Example
use anthropic_tools::common::errors::{AnthropicToolError, Result};
fn validate_api_key(key: &str) -> Result<()> {
if key.is_empty() {
return Err(AnthropicToolError::ApiKeyNotSet);
}
Ok(())
}Structs§
- Error
Detail - Error detail in API error response
- Error
Response - Error response from Anthropic API
Enums§
- Anthropic
Tool Error - Anthropic API error types