OpenAgentID documentation
Source referencesRust module referenceoas-sdk

oas-sdk · error

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

Source: oas/oas/oas-sdk/src/error.rs. SHA-256: 0457ecc9696116283584ed709d0dac7459d1d5353fe97385a37f8f6e8b1d5cd8.

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.

error::OasError

Unified error type for OAS SDK operations.

Aggregates errors from all underlying crates so callers need only handle one error type.

Examples

use oas_sdk::error::OasError;

fn example() -> Result<(), OasError> {
    // Any sub-crate error can be converted via `?`
    Ok(())
}
#[derive(Debug, Error)]
pub enum OasError {
    /// A DID parsing error.
    #[error("DID error: {0}")]
    Did(#[from] oas_did::DidError),

    /// A cryptographic operation error.
    #[error("crypto error: {0}")]
    Crypto(#[from] oas_crypto::CryptoError),

    /// A document operation error.
    #[error("document error: {0}")]
    Document(#[from] oas_document::DocumentError),

    /// A lineage verification error.
    #[error("lineage error: {0}")]
    Lineage(#[from] oas_lineage::LineageError),

    /// A privileged lineage authority verification error.
    #[error("lineage authority error: {reason}")]
    LineageAuthority {
        /// Description of why privileged authority was not accepted.
        reason: String,
    },

    /// A DID resolution error.
    #[cfg(feature = "resolve")]
    #[error("resolve error: {0}")]
    Resolve(#[from] oas_resolve::ResolveError),

    /// An attestation operation error.
    #[error("attestation error: {0}")]
    Attestation(#[from] oas_attestation::AttestationError),

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

    /// An SDK configuration or usage error.
    #[error("SDK error: {reason}")]
    Sdk {
        /// Description of what went wrong.
        reason: String,
    },
}

Source line: 25.

On this page