pub enum ModelError {
Backend(BackendError),
Config(ConfigError),
ModelNotFound {
model: String,
searched: Vec<String>,
},
Timeout {
operation: String,
duration_secs: u64,
},
RateLimit {
retry_after: Option<u64>,
},
InvalidRequest(String),
ParseError {
message: String,
raw: Option<String>,
},
StreamError(String),
Authentication(String),
Unsupported {
feature: String,
},
Cancelled,
}Expand description
Top-level error type for all model operations
Variants§
Backend(BackendError)
Backend-specific error (connection, API, etc)
Config(ConfigError)
Configuration error (invalid settings, missing keys, etc)
ModelNotFound
Model not found or unavailable
Timeout
Request timeout
RateLimit
Rate limit exceeded
InvalidRequest(String)
Invalid request (malformed input, bad parameters)
ParseError
Response parsing error
StreamError(String)
Stream error (connection dropped, incomplete response)
Authentication(String)
Authentication error
Unsupported
The adapter does not implement the requested feature (e.g. an
Anthropic adapter has no list_models endpoint, so the trait’s
default impl returns this).
Cancelled
The provider call was aborted by the turn’s cancellation
token. The effect runner swallows this silently — the
terminal Msg::TurnCancelled is emitted from drop_scope
after the scope’s JoinSet drains, so no UpstreamError
should reach the reducer for cancelled turns.
Implementations§
Source§impl ModelError
impl ModelError
Sourcepub fn to_user_facing(&self) -> UserFacingError
pub fn to_user_facing(&self) -> UserFacingError
Convert to user-facing error with actionable suggestions
Trait Implementations§
Source§impl Debug for ModelError
impl Debug for ModelError
Source§impl Display for ModelError
impl Display for ModelError
Source§impl Error for ModelError
impl Error for ModelError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Error> for ModelError
Conversion from anyhow::Error (for gradual migration)
impl From<Error> for ModelError
Conversion from anyhow::Error (for gradual migration)
Source§impl From<Error> for ModelError
Conversion from reqwest::Error
impl From<Error> for ModelError
Conversion from reqwest::Error
Auto Trait Implementations§
impl Freeze for ModelError
impl RefUnwindSafe for ModelError
impl Send for ModelError
impl Sync for ModelError
impl Unpin for ModelError
impl UnsafeUnpin for ModelError
impl UnwindSafe for ModelError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more