Skip to main content

Module error

Module error 

Source
Expand description

Cross-module error utilities.

If a variant in an agent error type (e.g. crate::llm::ProviderError, crate::tool::ToolError) needs to propagate an arbitrary std::error::Error, always use BoxError instead of a bare Box<dyn std::error::Error + Send + Sync>.

Using a newtype (rather than a type alias) has these advantages:

  • Shorter, more readable type signatures
  • Distinguishes from “any dyn Error” at the type level, making caller intent clearer
  • Future implementation changes (e.g. switching to anyhow::Error, adding backtrace support) require only one change

Structs§

BoxError
A type-erased error value. Carries an error from any source in a public API without exposing the concrete type.