OpenAgentID documentation
Source referencesRust module referenceopenagent-sdk

openagent-sdk · errors

Declared module signatures, types, configuration, and source documentation.

Source: openagent-sdk/sdks/rust/src/errors.rs. SHA-256: 0d1f1eb2ffaa998919d2141ddf3cd565a7e235accc1a85ebfd2a844b66140155.

This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.

errors::Result

Result alias for OpenAgent SDK operations.

pub type Result<T> = std::result::Result<T, OpenAgentError>;

Source line: 9.

errors::OpenAgentError

Unified error type for the OpenAgent SDK.

Wraps every error returned by the underlying OAS, Arsenal, and AEGIS layers so consumers don't need to learn three different error taxonomies.

Examples

use openagent_sdk::errors::{OpenAgentError, Result};

fn example() -> Result<()> {
    // Errors from any wrapped SDK convert via `?`.
    Ok(())
}
#[derive(Debug, Error)]
pub enum OpenAgentError {
    /// An error from the OAS identity layer.
    #[error("identity error: {0}")]
    Identity(#[from] oas_sdk::error::OasError),

    /// An error from the Arsenal capability/credential layer.
    #[cfg(feature = "arsenal")]
    #[error("credential error: {code:?}: {message}")]
    Credential {
        /// Numeric Arsenal error code.
        code: arsenal_core::error::ErrorCode,
        /// Human-readable description of what went wrong.
        message: String,
    },

    /// An error from the AEGIS verification layer.
    #[error("verification error: {0}")]
    Verification(String),

    /// An error from the AEGIS authentication layer.
    #[error("authentication error: {0}")]
    Authentication(String),

    /// An error from the AEGIS policy / authorization layer.
    #[error("authorization error: {0}")]
    Authorization(String),

    /// An error from the AEGIS delegation layer.
    #[error("delegation error: {0}")]
    Delegation(String),

    /// A skill policy violation reported by the [`crate::skills`] layer.
    #[error("skill denied: {skill}: {reason}")]
    SkillDenied {
        /// Name of the skill that was denied.
        skill: String,
        /// Reason the skill is denied.
        reason: String,
    },

    /// A configuration error in the SDK itself (missing parent, invalid scope, etc.).
    #[error("configuration error: {0}")]
    Config(String),

    /// An error in the underlying HTTP transport when proxying credentials.
    #[error("transport error: {0}")]
    Transport(String),

    /// A JSON serialization error from any of the layers.
    #[error("serialization error: {0}")]
    Json(#[from] serde_json::Error),
}

Source line: 27.

errors::OpenAgentError::config

Construct a configuration error from any displayable value.

pub fn config(msg: impl Into<String>) -> Self;

Source line: 82.

errors::OpenAgentError::transport

Construct a transport error from any displayable value.

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

Source line: 87.

On this page