pub enum AgentError {
Llm(String),
ToolNotFound(String),
ResponseParse(String),
Serde(Error),
Other(String),
}Expand description
Errors surfaced by Temporal activities and the agent loop.
Variants split along two axes: where the error originated (LLM, tool
registry, parser, serde) and whether it should be retried by Temporal
— see AgentError::is_retryable.
Variants§
Llm(String)
Upstream LLM provider error (network, rate limit, auth, etc.).
ToolNotFound(String)
LLM returned a tool call that the worker hasn’t registered.
ResponseParse(String)
LLM response couldn’t be parsed into a crate::state::LlmResponse.
Serde(Error)
JSON ser/de failure crossing the activity boundary.
Other(String)
Catch-all for activity-side failures we don’t otherwise classify.
Implementations§
Source§impl AgentError
impl AgentError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns true when the error is worth a Temporal retry.
Network blips, rate limits, and transient provider hiccups are retryable; missing tool registrations and parse failures are not — they indicate a code bug, not a transient condition.
Trait Implementations§
Source§impl Debug for AgentError
impl Debug for AgentError
Source§impl Display for AgentError
impl Display for AgentError
Source§impl Error for AgentError
impl Error for AgentError
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()
Auto Trait Implementations§
impl Freeze for AgentError
impl !RefUnwindSafe for AgentError
impl Send for AgentError
impl Sync for AgentError
impl Unpin for AgentError
impl UnsafeUnpin for AgentError
impl !UnwindSafe for AgentError
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request