Skip to main content

StepError

Enum StepError 

Source
#[non_exhaustive]
pub enum StepError {
Show 14 variants Effect(EffectError), Policy(PolicyError), Store(StoreError), Encoding(Error), Tool(ToolError), Undecidable { key: EffectKey, recovery: Recovery, detail: String, }, NonDeterminism { seq: Seq, expected: EffectKey, actual: EffectKey, }, Budget(BudgetExceeded), Suspended(SuspendReason), Denied { action: String, resource: String, reason: String, }, GroupFootprint { group: String, detail: String, }, GroupAborted { what: String, }, GroupUnsettled { group: String, detail: String, }, ReplayOverrun { actual: EffectKey, },
}
Expand description

Failure surfaced to a skill through StepCtx.

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

Effect(EffectError)

§

Policy(PolicyError)

§

Store(StoreError)

§

Encoding(Error)

§

Tool(ToolError)

A tool call could not be prepared: the tool is not in the operator’s catalogue, or the arguments do not match what it declared.

The same conversion SkillError::Tool provides, one level down, and it is load-bearing for the same reason. sink_with is how a governed tool call is written — the closure hands back whatever building the effect produced — and BuildsEffect accepts a Result only when its error converts to this type. Without this variant the trait’s stated purpose (“ToolCall::prepare, which refuses a tool the catalogue does not hold, returns the Result it already produces”) was a capability nothing could use, and the published snippet that exercises it did not compile.

A refusal here dispatched nothing, so it fails the step rather than leaving doubt: the catalogue was consulted before any call left.

§

Undecidable

The outcome of an effect cannot be determined, and its declared Recovery forbids guessing.

Reached two ways, which are the same situation from different directions: a crash landed between “sent” and “recorded”, or the call itself failed InDoubt. Either way the journal cannot distinguish “never applied” from “applied, acknowledgement lost”, and for anything that mutates, the runtime escalates rather than guess.

A distinct variant rather than a message, because the executor quarantines on it — and a run’s disposition must not hinge on the wording of a string.

Fields

§recovery: Recovery
§detail: String
§

NonDeterminism

Surfaced when replay finds the recorded run took a different path.

Fields

§seq: Seq
§expected: EffectKey
§actual: EffectKey
§

Budget(BudgetExceeded)

A limit stopped the run before it spent more.

Not a fault: the run did what it was told, and what it was told included a ceiling. Distinct from an ordinary failure so an operator can tell “this needs a bigger budget” from “this is broken”.

§

Suspended(SuspendReason)

Not a failure. The run is waiting for something that has not happened, and its frame has been persisted.

Propagate it with ?. A skill that catches this turns a durable wait into a silent hang: the subscription stays registered, the event eventually arrives, and it resumes a run that has already decided it finished. It is modelled as an error only because that is how control leaves a skill — the run is healthy.

§

Denied

Policy refused the effect.

Separate from Budget because the two are answered differently: a limit is raised, a rule is argued with. Collapsing them would put “ask for more quota” and “you are not allowed to do this” behind one message.

Fields

§action: String
§resource: String
§reason: String
§

GroupFootprint

A member did not fit the group it was added to.

A footprint violation, a mutating effect declared as a read, a nested group, or an empty footprint. Every one of these is caught before the effect runs, which is the only time catching it is free.

Fields

§group: String
§detail: String
§

GroupAborted

A group was taken back whole, and nothing it did is standing.

Not a quarantine and not a silent failure: every reversible member was reversed, no deferred member ran, and what says which condition stopped it. A caller may handle this and carry on, which is the point of grouping in the first place.

Fields

§what: String
§

GroupUnsettled

A group could be neither committed nor taken back.

A reversal failed, or a member is in doubt. The run is quarantined, because a partially unwound group is a state nobody declared and no later code can reason about. This is the honest report of the situation that other systems surface as a success with a warning.

Fields

§group: String
§detail: String
§

ReplayOverrun

Strict replay reached the end of history and the code asked for another effect. The recorded run did less than this code does — divergence that ordered key comparison alone cannot see, because there is nothing left to compare against.

Fields

§actual: EffectKey

Trait Implementations§

Source§

impl Debug for StepError

Source§

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

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

impl Display for StepError

Source§

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

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

impl Error for StepError

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<BudgetExceeded> for StepError

Source§

fn from(source: BudgetExceeded) -> Self

Converts to this type from the input type.
Source§

impl From<EffectError> for StepError

Source§

fn from(source: EffectError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for StepError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<PolicyError> for StepError

Source§

fn from(source: PolicyError) -> Self

Converts to this type from the input type.
Source§

impl From<StepError> for SkillError

Source§

fn from(source: StepError) -> Self

Converts to this type from the input type.
Source§

impl From<StoreError> for StepError

Source§

fn from(source: StoreError) -> Self

Converts to this type from the input type.
Source§

impl From<ToolError> for StepError

Source§

fn from(source: ToolError) -> Self

Converts to this type from the input type.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more