OpenAgentID documentation
Source referencesRust module referenceopenagent-server

openagent-server · error

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

Source: openagents/openagent.id/crates/openagent-server/src/error.rs. SHA-256: b02b125967dab737185e3e4f93279af42dab8cd530ffccc054abefd129a798d5.

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::ErrorCode

Error codes defined by the OpenAgent protocol.

#[derive(Debug, Clone, Copy, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ErrorCode {
    /// No Authorization header and no valid session token.
    AuthenticationRequired,
    /// Challenge nonce has expired (older than TTL window).
    ChallengeExpired,
    /// Signature verification failed against the challenge bytes.
    InvalidSignature,
    /// The key type in X-OpenAgent-Key-Type is not supported.
    UnsupportedKeyType,
    /// The nonce was already consumed or is not recognized.
    NonceUnknown,
    /// The agent's trust tier is below the route's minimum.
    TrustInsufficient,
    /// Legacy lineage evidence reached a privileged authorization boundary.
    LegacyLineageNotAuthoritative,
    /// No authoritative lineage verifier result is available.
    LineageVerificationUnavailable,
    /// Rate limit exceeded for this agent's trust tier.
    RateLimited,
    /// The Authorization header is present but malformed.
    MalformedRequest,
    /// Session token is expired or invalid.
    SessionExpired,
    /// Internal server error during verification.
    InternalError,
}

Source line: 12.

error::OpenAgentError

Structured error response per OPENAGENT-CORE-SPEC.md §13.

#[derive(Debug, Serialize)]
pub struct OpenAgentError {
pub error: ErrorCode,
pub message: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub details: Option<serde_json::Value>,
pub request_id: String
}

Source line: 60.

error::OpenAgentError::new

pub fn new(code: ErrorCode, message: impl Into<String>, request_id: impl Into<String>) -> Self;

Source line: 69.

On this page