Expand description
§Error Types
Error types for the Bob Agent Framework.
This module provides comprehensive error handling with:
AgentError: Top-level error enum wrapping all error typesLlmError: Errors from LLM providersToolError: Errors from tool executionStoreError: Errors from session storage
§Error Handling Strategy
All errors use thiserror for ergonomic error definitions and implement:
std::error::Errorfor compatibilityDisplayfor user-friendly messagesFromfor automatic conversion
§Example
ⓘ
use bob_core::error::{AgentError, LlmError};
fn handle_error(err: AgentError) {
match err {
AgentError::Llm(e) => eprintln!("LLM error: {}", e),
AgentError::Tool(e) => eprintln!("Tool error: {}", e),
AgentError::Policy(msg) => eprintln!("Policy violation: {}", msg),
AgentError::Timeout => eprintln!("Operation timed out"),
_ => eprintln!("Other error: {}", err),
}
}Enums§
- Agent
Error - Top-level agent error.
- Cost
Error - Cost meter errors.
- LlmError
- LLM adapter errors.
- Store
Error - Session store errors.
- Tool
Error - Tool execution errors.