pub enum ModelError {
Backend(BackendError),
Config(ConfigError),
ModelNotFound {
model: String,
searched: Vec<String>,
},
Timeout {
operation: String,
duration_secs: u64,
},
RateLimit {
retry_after: Option<u64>,
message: Option<String>,
},
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. retry_after is the server’s Retry-After in
seconds when it sent one; message is the human-readable reason from
the 429 response body when one could be extracted (e.g. Cloudflare’s
“used up your daily free allocation of 10,000 neurons”) — the
difference between “wait a moment” and “upgrade your plan”.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for 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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> 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