pub struct ErrorSource {
pub task: Option<String>,
pub agent: Option<String>,
pub provider: Option<String>,
pub model: Option<String>,
pub tool_ref: Option<String>,
pub script: Option<String>,
pub line: Option<u32>,
}Expand description
Where in the workflow an error originated. Every field is optional — fill what you know, leave the rest. SDKs render whichever fields are present; downstream tools (logs, OTel) read them as structured attributes for filtering/aggregation.
Fields§
§task: Option<String>Workflow-author-declared task name (matches task <name> in source).
agent: Option<String>Agent name from the matching agent <name> declaration.
provider: Option<String>Provider id when the error came from an LLM/provider call
(anthropic, google, openai, …).
model: Option<String>Model alias (opus_4_7, gpt_4o_mini, …).
tool_ref: Option<String>MCP <alias>.<tool> reference when the error came from a tool call.
script: Option<String>Script name when the error came from a sub-script (call(...)).
line: Option<u32>1-indexed source line in the originating .akr file.
Implementations§
Source§impl ErrorSource
impl ErrorSource
pub fn empty() -> Self
pub fn is_empty(&self) -> bool
Sourcepub fn with_task(self, task: impl Into<String>) -> Self
pub fn with_task(self, task: impl Into<String>) -> Self
Builder helpers — chainable, infallible.
pub fn with_agent(self, agent: impl Into<String>) -> Self
pub fn with_provider(self, provider: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_tool_ref(self, tool_ref: impl Into<String>) -> Self
pub fn with_script(self, script: impl Into<String>) -> Self
pub fn with_line(self, line: u32) -> Self
Trait Implementations§
Source§impl Clone for ErrorSource
impl Clone for ErrorSource
Source§fn clone(&self) -> ErrorSource
fn clone(&self) -> ErrorSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ErrorSource
impl Debug for ErrorSource
Source§impl Default for ErrorSource
impl Default for ErrorSource
Source§fn default() -> ErrorSource
fn default() -> ErrorSource
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ErrorSource
impl<'de> Deserialize<'de> for ErrorSource
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ErrorSource
impl PartialEq for ErrorSource
Source§fn eq(&self, other: &ErrorSource) -> bool
fn eq(&self, other: &ErrorSource) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ErrorSource
impl Serialize for ErrorSource
impl StructuralPartialEq for ErrorSource
Auto Trait Implementations§
impl Freeze for ErrorSource
impl RefUnwindSafe for ErrorSource
impl Send for ErrorSource
impl Sync for ErrorSource
impl Unpin for ErrorSource
impl UnsafeUnpin for ErrorSource
impl UnwindSafe for ErrorSource
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