pub enum AgentError {
MissingRequiredField {
field: String,
},
ContractViolation {
message: String,
},
HostConfigurationNeeded {
message: String,
},
Classified {
kind: AgentErrorKind,
retry: RetryClassification,
context: Box<ErrorContext>,
causal_ids: Box<CausalIds>,
},
}Expand description
Enumerates the finite agent error cases. Serialized names are part of the SDK contract; update fixtures when variants change.
Variants§
MissingRequiredField
Use this variant when the contract needs to represent missing required field; selecting it has no side effect by itself.
ContractViolation
Use this variant when the contract needs to represent contract violation; selecting it has no side effect by itself.
HostConfigurationNeeded
Use this variant when the contract needs to represent host configuration needed; selecting it has no side effect by itself.
Classified
Use this variant when the contract needs to represent classified; selecting it has no side effect by itself.
Fields
kind: AgentErrorKindKind/category for this record, capability, event, or detected resource.
retry: RetryClassificationRetry used by this record or request.
context: Box<ErrorContext>Context used by this record or request.
Implementations§
Source§impl AgentError
impl AgentError
Sourcepub fn new(
kind: AgentErrorKind,
retry: RetryClassification,
message: impl Into<String>,
) -> Self
pub fn new( kind: AgentErrorKind, retry: RetryClassification, message: impl Into<String>, ) -> Self
Creates a new domain::error value with explicit caller-provided inputs. This constructor is data-only and performs no I/O or external side effects.
Sourcepub fn kind(&self) -> AgentErrorKind
pub fn kind(&self) -> AgentErrorKind
Builds the kind value. This is data construction and performs no I/O, journal append, event publication, or process work.
Sourcepub fn retry(&self) -> RetryClassification
pub fn retry(&self) -> RetryClassification
Builds the retry value. This is data construction and performs no I/O, journal append, event publication, or process work.
Sourcepub fn context(&self) -> ErrorContext
pub fn context(&self) -> ErrorContext
Builds the context value. This is data construction and performs no I/O, journal append, event publication, or process work.
Sourcepub fn causal_ids(&self) -> CausalIds
pub fn causal_ids(&self) -> CausalIds
Builds the causal ids value. This is data construction and performs no I/O, journal append, event publication, or process work.
Sourcepub fn with_policy_ref(self, policy_ref: PolicyRef) -> Self
pub fn with_policy_ref(self, policy_ref: PolicyRef) -> Self
Returns this value with its policy ref setting replaced. The method follows builder-style data construction and does not execute external work.
Sourcepub fn with_source(self, source: SourceRef) -> Self
pub fn with_source(self, source: SourceRef) -> Self
Returns this value with its source setting replaced. The method follows builder-style data construction and does not execute external work.
Sourcepub fn with_destination(self, destination: DestinationRef) -> Self
pub fn with_destination(self, destination: DestinationRef) -> Self
Returns this value with its destination setting replaced. The method follows builder-style data construction and does not execute external work.
Sourcepub fn with_subject(self, subject: EntityRef) -> Self
pub fn with_subject(self, subject: EntityRef) -> Self
Returns this value with its subject setting replaced. The method follows builder-style data construction and does not execute external work.
Sourcepub fn with_causal_ids(self, causal_ids: CausalIds) -> Self
pub fn with_causal_ids(self, causal_ids: CausalIds) -> Self
Returns this value with its causal ids setting replaced. The method follows builder-style data construction and does not execute external work.
Sourcepub fn missing_required_field(field: impl Into<String>) -> Self
pub fn missing_required_field(field: impl Into<String>) -> Self
Builds the missing required field value. This is data construction and performs no I/O, journal append, event publication, or process work.
Sourcepub fn contract_violation(message: impl Into<String>) -> Self
pub fn contract_violation(message: impl Into<String>) -> Self
Builds the contract violation value. This is data construction and performs no I/O, journal append, event publication, or process work.
Sourcepub fn host_configuration_needed(message: impl Into<String>) -> Self
pub fn host_configuration_needed(message: impl Into<String>) -> Self
Builds the host configuration needed value. This is data construction and performs no I/O, journal append, event publication, or process work.
Trait Implementations§
Source§impl Clone for AgentError
impl Clone for AgentError
Source§fn clone(&self) -> AgentError
fn clone(&self) -> AgentError
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 AgentError
impl Debug for AgentError
Source§impl<'de> Deserialize<'de> for AgentError
impl<'de> Deserialize<'de> for AgentError
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>,
Source§impl Display for AgentError
impl Display for AgentError
Source§impl Error for AgentError
impl Error for AgentError
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()
Source§impl From<TypedOutputError> for AgentError
impl From<TypedOutputError> for AgentError
Source§fn from(error: TypedOutputError) -> Self
fn from(error: TypedOutputError) -> Self
Source§impl PartialEq for AgentError
impl PartialEq for AgentError
Source§fn eq(&self, other: &AgentError) -> bool
fn eq(&self, other: &AgentError) -> bool
self and other values to be equal, and is used by ==.