//! Errors for the commit layer.

/// Errors surfaced by `CommitLayer`.
#[derive(Debug, thiserror::Error)]
pub enum Error {
    /// Canonical encoding/decoding failure.
    #[error("canonical: {0}")]
    Canonical(#[from] ontoref_types::Error),
    /// Requested cell does not exist in the commit layer; no witness can be
    /// built.
    #[error("cell not found in commit layer")]
    CellNotFound,
}

/// Convenience alias.
pub type Result<T> = std::result::Result<T, Error>;
