#[non_exhaustive]pub enum SdkError {
Show 31 variants
ModelNotFound {
model_id: String,
},
ProviderNotFound {
provider: String,
},
AllProvidersExhausted {
attempts: usize,
},
ModelExcluded {
model_id: String,
},
AgentNotRunnable {
agent_id: String,
status: String,
},
AgentAlreadyRunning {
agent_id: String,
},
SnapshotNotFound {
agent_id: String,
},
SnapshotCorrupt {
agent_id: String,
reason: String,
},
PermissionDenied {
subject: String,
capability: String,
},
CapabilityExpired {
subject: String,
},
WorkItemNotFound {
item_id: String,
},
VersionConflict {
key: String,
expected: u64,
current: u64,
},
VoteNotFound {
vote_id: String,
},
InvalidState {
entity: String,
reason: String,
},
MiddlewareBlocked {
middleware: String,
reason: String,
},
TokenBudgetExceeded {
used: usize,
budget: usize,
},
CostBudgetExceeded {
used: f64,
budget: f64,
},
RoutingDisabled,
NoRouteAvailable {
model_id: String,
},
ExecutionFailed {
reason: String,
},
GroupExecutionFailed {
failed: usize,
total: usize,
},
Cancelled,
PortNotConfigured {
port: &'static str,
},
UnknownScheme {
scheme: String,
},
Io(Error),
Serialization {
context: &'static str,
source: Error,
},
AlreadyExists {
key: String,
},
CatalogUnavailable {
reason: String,
},
CatalogOverrideParse {
path: String,
reason: String,
},
CatalogRefresh {
reason: String,
},
Internal(Error),
}Expand description
oxicode-sdk structured error type.
SDK consumers can use match to handle specific error cases.
Internal implementations may still use anyhow, converted at public API boundaries.
#[non_exhaustive] — consumers MUST add a catch-all _ => arm in their
match expressions so that new variants added in future minor releases do
not break compilation. Existing named variants are frozen; their meaning
does not change between releases (see docs/release-process.md).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ModelNotFound
The requested model could not be resolved by any configured provider.
ProviderNotFound
No provider matching the requested name is registered with the SDK.
AllProvidersExhausted
Every provider in the failover chain was attempted and failed.
ModelExcluded
The model exists but is excluded from resolution by routing control.
AgentNotRunnable
The agent exists but cannot run in its current lifecycle status.
Fields
AgentAlreadyRunning
An attempt was made to start an agent that is already running.
SnapshotNotFound
No persisted snapshot could be found for the agent.
SnapshotCorrupt
A persisted snapshot exists but failed integrity validation.
Fields
PermissionDenied
The principal lacks a required capability for the requested action.
Fields
CapabilityExpired
A previously granted capability has expired and is no longer valid.
WorkItemNotFound
A referenced coordination work item does not exist.
VersionConflict
An optimistic-concurrency guard detected a stale version of a value.
Fields
VoteNotFound
A referenced vote session could not be found.
InvalidState
A state-machine precondition was violated (wrong status for the operation).
Fields
MiddlewareBlocked
A middleware intercepted and blocked the request.
Fields
TokenBudgetExceeded
The configured token-usage budget for a run was exceeded.
Fields
CostBudgetExceeded
The configured monetary cost budget for a run was exceeded.
Fields
RoutingDisabled
Routing is disabled in the current configuration.
NoRouteAvailable
No route could be determined for the requested model.
ExecutionFailed
A single agent’s execution failed.
GroupExecutionFailed
One or more agents in a group run failed.
Fields
Cancelled
The run was cancelled before completing.
PortNotConfigured
A required port was never configured on the builder.
UnknownScheme
A URL scheme has no registered handler.
Io(Error)
A file-system or device I/O error in a port adapter.
Serialization
A serialization or deserialization failure.
AlreadyExists
An entry with the same key or path already exists.
The catalog port is not wired or returned no data for the request.
CatalogOverrideParse
A user-supplied catalog override file failed to parse.
Fields
CatalogRefresh
A catalog refresh attempt failed (network, HTTP, or parse error). The stale snapshot is still served; this error is informational.
Internal(Error)
An unexpected internal error, converted from an anyhow::Error.
Implementations§
Trait Implementations§
Source§impl Error for SdkError
impl Error for SdkError
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()