pub struct WorkflowError { /* private fields */ }Expand description
A workflow error: a sentinel kind, its full message text, and an optional cause.
Implementations§
Source§impl WorkflowError
impl WorkflowError
Sourcepub fn new(kind: WorkflowErrorKind, message: impl Into<String>) -> Self
pub fn new(kind: WorkflowErrorKind, message: impl Into<String>) -> Self
A workflow error of kind whose text is message, the full text built by the caller (e.g.
"<sentinel text>: <detail>").
Sourcepub fn with_source(self, source: AgentError) -> Self
pub fn with_source(self, source: AgentError) -> Self
Sets the wrapped cause; the message is unchanged, since the caller already formatted it.
Sourcepub fn kind(&self) -> WorkflowErrorKind
pub fn kind(&self) -> WorkflowErrorKind
The error’s kind.
Sourcepub fn is(&self, kind: WorkflowErrorKind) -> bool
pub fn is(&self, kind: WorkflowErrorKind) -> bool
Whether this error is of kind: its own kind, a kind it implies (NodeWaitingForOutput
implies NodeInterrupted, OutputValidation implies NodeFailed), or the same test on the
wrapped cause.
Sourcepub fn sentinel_text(kind: WorkflowErrorKind) -> &'static str
pub fn sentinel_text(kind: WorkflowErrorKind) -> &'static str
The message text of the bare sentinel for kind.
Sourcepub fn sentinel(kind: WorkflowErrorKind) -> Self
pub fn sentinel(kind: WorkflowErrorKind) -> Self
The bare sentinel error of kind, carrying Self::sentinel_text.
Sourcepub fn cause(&self) -> Option<&AgentError>
pub fn cause(&self) -> Option<&AgentError>
The wrapped cause, if any.
Sourcepub fn node_run(info: NodeRunError) -> Self
pub fn node_run(info: NodeRunError) -> Self
A dynamic child run failure: the kind is the cause’s workflow kind, else NodeFailed; the
message names the child by path (or by name when the path is empty), followed by the cause,
or <nil cause> when there is none.
Sourcepub fn node_run_error(&self) -> Option<&NodeRunError>
pub fn node_run_error(&self) -> Option<&NodeRunError>
The dynamic child run failure this error reports, if it is one.
Trait Implementations§
Source§impl Clone for WorkflowError
impl Clone for WorkflowError
Source§impl Debug for WorkflowError
impl Debug for WorkflowError
Source§impl Display for WorkflowError
impl Display for WorkflowError
Source§impl Error for WorkflowError
impl Error for WorkflowError
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()