Skip to main content

HarnessError

Enum HarnessError 

Source
#[non_exhaustive]
pub enum HarnessError { CapabilityNotSupported { primitive: String, }, StaleTarget { detail: String, }, Transport { detail: String, }, Protocol { detail: String, }, Harness { detail: String, }, }
Expand description

The neutral error taxonomy for the harness-integration seam.

Every arm is harness-neutral. Self::CapabilityNotSupported is the first-class outcome an observability-only harness returns from crate::AgentSession::intervene for any command — it is a legitimate, gated rejection, not an internal failure.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

CapabilityNotSupported

The requested intervention primitive is not in the harness’s advertised capability set.

This is the first-class rejection an observability-only harness (empty capability set) returns for every command, and the rejection any harness returns for a primitive it did not advertise. It is a normal, expected outcome of capability gating — not a fault.

Fields

§primitive: String

A neutral label naming the unsupported primitive (e.g. "pause_resume").

§

StaleTarget

The command targets a stale or unknown activity attempt and is a no-op.

A command addressed to a superseded attempt (a later attempt is now live) or to a session that has already reached its terminal result is dropped without effect.

Fields

§detail: String

Human-readable detail describing why the target is stale.

§

Transport

The underlying transport failed (spawn/connect failure, broken pipe, EOF, I/O error).

Neutral: it describes that the transport failed and carries the detail, never which transport. An adapter maps its own I/O failures here.

Fields

§detail: String

Human-readable description of the transport failure.

§

Protocol

A message was received that violates the wire protocol contract.

Malformed framing, an undecodable envelope, a response that correlates to no outstanding request, or a terminal result delivered on the wrong message kind. This signals a bug in the peer or the adapter, distinct from an ordinary transport outage.

Fields

§detail: String

Human-readable description of the protocol violation.

§

Harness

The harness reported an application-level failure while running the agent.

The agent ran but ended in failure (a non-success exit, an error result, a rejected run). Distinct from Self::Transport (the channel broke) and Self::Protocol (a malformed message): here the channel and framing were sound and the harness reported failure.

Fields

§detail: String

Human-readable description of the reported failure.

Implementations§

Source§

impl HarnessError

Source

pub fn capability_not_supported(primitive: impl Into<String>) -> Self

Builds a Self::CapabilityNotSupported naming the unsupported primitive.

Source

pub fn stale_target(detail: impl Into<String>) -> Self

Builds a Self::StaleTarget with a detail message.

Source

pub fn transport(detail: impl Into<String>) -> Self

Builds a Self::Transport with a detail message.

Source

pub fn protocol(detail: impl Into<String>) -> Self

Builds a Self::Protocol with a detail message.

Source

pub fn harness(detail: impl Into<String>) -> Self

Builds a Self::Harness with a detail message.

Trait Implementations§

Source§

impl Clone for HarnessError

Source§

fn clone(&self) -> HarnessError

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 HarnessError

Source§

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

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

impl Display for HarnessError

Source§

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

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

impl Eq for HarnessError

Source§

impl Error for HarnessError

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 PartialEq for HarnessError

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for HarnessError

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