pub enum ClassifiedError {
Show 17 variants
RateLimited {
provider: String,
retry_after: Option<Duration>,
},
ProviderUnavailable {
provider: String,
reason: String,
},
AuthFailed {
provider: String,
},
ContextOverflow {
tokens: u32,
},
OutputTruncated,
StreamTimeout(Duration),
ToolError {
tool: String,
message: String,
},
ToolNotFound(String),
BudgetExhausted(u32),
Io(String),
Http(String),
Parse(String),
Config(String),
Session(String),
Storage(String),
Runtime(String),
Internal(String),
}Expand description
Classified error with recovery semantics.
Variants§
RateLimited
Provider returned 429 / quota exceeded.
Provider is unreachable, 5xx, or degraded.
AuthFailed
Credential rejected (401/403).
ContextOverflow
Request size exceeds model context window.
OutputTruncated
Response truncated at max_tokens.
StreamTimeout(Duration)
SSE stream produced no chunk for the configured idle window.
ToolError
Tool reported a domain error (non-fatal).
ToolNotFound(String)
Referenced tool name is not registered.
BudgetExhausted(u32)
Iteration budget exhausted (including grace call).
Io(String)
Filesystem or OS error.
Http(String)
HTTP transport error.
Parse(String)
JSON or protocol parsing error.
Config(String)
Configuration or setup problem.
Session(String)
Session or conversation state problem.
Storage(String)
Storage / persistence problem (file I/O, L3 write).
Runtime(String)
Runtime / agent loop problem.
Internal(String)
Invariant violation inside Roma itself.
Implementations§
Source§impl ClassifiedError
impl ClassifiedError
Sourcepub fn variant_name(&self) -> &'static str
pub fn variant_name(&self) -> &'static str
Return the variant name as a static string.
Sourcepub fn from_tagged(kind: &str, msg: &str, retry_after_secs: Option<u64>) -> Self
pub fn from_tagged(kind: &str, msg: &str, retry_after_secs: Option<u64>) -> Self
Reconstruct an error from its serialized parts.
retry_after_secs is only used for the RateLimited variant.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether the error is worth retrying (same or different provider).
Sourcepub fn recovery_hint(&self) -> RecoveryAction
pub fn recovery_hint(&self) -> RecoveryAction
Suggested recovery action.
Trait Implementations§
Source§impl Clone for ClassifiedError
impl Clone for ClassifiedError
Source§fn clone(&self) -> ClassifiedError
fn clone(&self) -> ClassifiedError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClassifiedError
impl Debug for ClassifiedError
Source§impl Display for ClassifiedError
impl Display for ClassifiedError
Source§impl Error for ClassifiedError
impl Error for ClassifiedError
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()