Skip to main content

AgentError

Enum AgentError 

Source
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.

Fields

§field: String

Field used by this record or request.

§

ContractViolation

Use this variant when the contract needs to represent contract violation; selecting it has no side effect by itself.

Fields

§message: String

Message used by this record or request.

§

HostConfigurationNeeded

Use this variant when the contract needs to represent host configuration needed; selecting it has no side effect by itself.

Fields

§message: String

Message used by this record or request.

§

Classified

Use this variant when the contract needs to represent classified; selecting it has no side effect by itself.

Fields

§kind: AgentErrorKind

Kind/category for this record, capability, event, or detected resource.

§retry: RetryClassification

Retry used by this record or request.

§context: Box<ErrorContext>

Context used by this record or request.

§causal_ids: Box<CausalIds>

Identifiers used to select or correlate causal values. Use them for typed lookup, filtering, or lineage instead of stringly typed matching.

Implementations§

Source§

impl AgentError

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> AgentError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AgentError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AgentError

Source§

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 Display for AgentError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for AgentError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<TypedOutputError> for AgentError

Source§

fn from(error: TypedOutputError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for AgentError

Source§

fn eq(&self, other: &AgentError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for AgentError

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for AgentError

Source§

impl StructuralPartialEq for AgentError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,