Skip to main content

ErrorCode

Enum ErrorCode 

Source
#[non_exhaustive]
pub enum ErrorCode {
Show 50 variants TypesInvalidId, TypesValidation, TypesSerde, ToolNotFound, ToolInvalidArgs, ToolExecution, ToolTimeout, ToolCancelled, ToolDenied, ToolApprovalDenied, ToolStreamProtocol, ToolRateLimited, ToolConcurrencyLimit, ToolNetwork, ToolServiceUnavailable, LlmProvider, LlmCancelled, LlmInvalidResponse, LlmAuth, LlmRateLimit, LlmIdleTimeout, LlmEmptyResponse, LlmTruncated, AgentInvalidDefinition, AgentBuild, AgentNotFound, RuntimeMaxSteps, RuntimeCancelled, RuntimeGate, RuntimeStructuredOutput, RuntimeDeadline, RuntimeStationarity, HostSpawn, HostBudget, HostDepth, HostConcurrency, HostUnsupported, HostCancelled, HostIsolation, WorkflowScript, WorkflowDivergence, WorkflowJournal, WorkflowBudget, WorkflowCancelled, WorkflowValidate, StateInvariant, StatePersistence, CompactionFailed, CompactionOverflow, Internal,
}
Expand description

Machine-stable error code for control-plane handling.

Codes use dotted domain.reason strings via ErrorCode::as_str.

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

TypesInvalidId

Invalid or empty identifier.

§

TypesValidation

Message or payload failed validation.

§

TypesSerde

Serialization failure.

§

ToolNotFound

Tool not found in registry.

§

ToolInvalidArgs

Tool arguments failed schema/parse.

§

ToolExecution

Tool execution failed.

§

ToolTimeout

Tool timed out.

§

ToolCancelled

Tool cancelled.

§

ToolDenied

Tool denied by policy/capability.

§

ToolApprovalDenied

Tool call rejected by approval gate.

§

ToolStreamProtocol

Tool stream ended without a terminal item (protocol violation).

§

ToolRateLimited

Tool rate limited by upstream service.

§

ToolConcurrencyLimit

Tool concurrency limit exceeded.

§

ToolNetwork

Tool network failure.

§

ToolServiceUnavailable

Tool upstream service unavailable.

§

LlmProvider

LLM transport or provider failure.

§

LlmCancelled

LLM request cancelled.

§

LlmInvalidResponse

LLM response invalid.

§

LlmAuth

LLM authentication / authorization failure.

§

LlmRateLimit

LLM rate limited.

§

LlmIdleTimeout

Stream/sample idle timeout between chunks.

§

LlmEmptyResponse

Provider returned an empty completion (no text / tool calls).

§

LlmTruncated

Output truncated (max tokens / length limit).

§

AgentInvalidDefinition

Agent definition invalid.

§

AgentBuild

Agent build failure.

§

AgentNotFound

Agent type / definition not found for resolution.

§

RuntimeMaxSteps

Turn hit max steps.

§

RuntimeCancelled

Turn cancelled.

§

RuntimeGate

Runtime gate rejected the outcome.

§

RuntimeStructuredOutput

Structured output failed schema validation after retries.

§

RuntimeDeadline

Turn deadline exceeded.

§

RuntimeStationarity

Identical tool calls repeated past the stationarity hard stop.

§

HostSpawn

Host spawn failed.

§

HostBudget

Agent budget exhausted.

§

HostDepth

Nested spawn depth exceeded.

§

HostConcurrency

Concurrent nested agent cap exceeded.

§

HostUnsupported

Host capability unsupported.

§

HostCancelled

Host cancelled.

§

HostIsolation

Isolation backend failure.

§

WorkflowScript

Workflow script compile/runtime failure.

§

WorkflowDivergence

Journal divergence on resume.

§

WorkflowJournal

Journal I/O or integrity failure.

§

WorkflowBudget

Workflow agent budget exceeded.

§

WorkflowCancelled

Workflow cancelled.

§

WorkflowValidate

Workflow validation / probe failure.

§

StateInvariant

Conversation state invariant violated (e.g. dangling tool call).

§

StatePersistence

Persistence backend I/O failure.

§

CompactionFailed

Compaction strategy failed.

§

CompactionOverflow

Context still exceeds limits after compaction.

§

Internal

Generic internal failure.

Implementations§

Source§

impl ErrorCode

Source

pub const fn as_str(self) -> &'static str

Stable snake_case dotted code string.

Source

pub const fn domain(self) -> &'static str

Domain prefix (types, tool, llm, …).

Source

pub const fn default_retry(self) -> RetryClass

Default retry classification for this code.

Kernel paths set an explicit RetryClass when they know more; this is the baseline hosts may consult.

Trait Implementations§

Source§

impl Clone for ErrorCode

Source§

fn clone(&self) -> ErrorCode

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 Copy for ErrorCode

Source§

impl Debug for ErrorCode

Source§

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

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

impl<'de> Deserialize<'de> for ErrorCode

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 ErrorCode

Source§

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

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

impl Eq for ErrorCode

Source§

impl Hash for ErrorCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ErrorCode

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for ErrorCode

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 StructuralPartialEq for ErrorCode

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.