supercode-interchange 0.4.10

Canonical, provider-neutral session interchange primitives for Supercode
Documentation
//! Errors produced while loading, translating, and persisting sessions.

use thiserror::Error;

/// Result type for interchange operations.
pub type Result<T> = std::result::Result<T, InterchangeError>;

/// An error at a native session-format boundary.
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum InterchangeError {
    /// A serialized value could not be decoded or encoded.
    #[error("failed to process session JSON: {0}")]
    Decode(#[from] serde_json::Error),

    /// A persisted session artifact violated its framing or schema contract.
    #[error("invalid session artifact: {0}")]
    InvalidSession(String),

    /// A filesystem operation failed.
    #[error("io error: {0}")]
    Io(#[from] std::io::Error),

    /// A format-specific operation failed without a narrower stable category.
    #[error("{0}")]
    Other(String),
}