pub enum ModelClientError {
RateLimit(String),
Auth(String),
ContextOverflow(String),
BadRequest(String),
ServerError(String),
Network(String),
Other(String),
}Expand description
Categorised model-client failures. Mirrors NativeHarnessError’s
Model* variants 1:1 so the agent loop can map across without
pattern-matching gymnastics.
Retryability:
RateLimit/Network/ServerError→ transient, safe to retry with backoffAuth/ContextOverflow/BadRequest→ config error, never retry
Variants§
RateLimit(String)
HTTP 429 — back off and retry.
Auth(String)
HTTP 401 / 403 — wrong key or no permission; do not retry.
ContextOverflow(String)
HTTP 400 that looks like context overflow; do not retry.
BadRequest(String)
HTTP 400 (invalid model, bad params, etc.) — config error; do not retry.
ServerError(String)
HTTP 5xx or transport failure — transient; safe to retry.
Network(String)
DNS / TCP / TLS failure — transient; safe to retry.
Other(String)
Anything else we couldn’t bucket; treated as non-retryable.
Implementations§
Trait Implementations§
Source§impl Debug for ModelClientError
impl Debug for ModelClientError
Source§impl Display for ModelClientError
impl Display for ModelClientError
Source§impl Error for ModelClientError
impl Error for ModelClientError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ModelClientError> for CompactionError
impl From<ModelClientError> for CompactionError
Source§fn from(source: ModelClientError) -> Self
fn from(source: ModelClientError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ModelClientError
impl RefUnwindSafe for ModelClientError
impl Send for ModelClientError
impl Sync for ModelClientError
impl Unpin for ModelClientError
impl UnsafeUnpin for ModelClientError
impl UnwindSafe for ModelClientError
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
Mutably borrows from an owned value. Read more