Skip to main content

mnemo_amp/
error.rs

1//! AMP adapter error type.
2
3use thiserror::Error;
4
5/// Errors surfaced by the AMP adapter surface.
6#[derive(Debug, Error)]
7pub enum AmpError {
8    /// The envelope was malformed for its op (missing `content`,
9    /// `query`, `memory_ids`, etc.).
10    #[error("invalid AMP envelope: {0}")]
11    Validation(String),
12
13    /// A referenced memory id did not resolve.
14    #[error("not found: {0}")]
15    NotFound(String),
16
17    /// The underlying [`MnemoEngine`](mnemo_core::query::MnemoEngine)
18    /// returned an error.
19    #[error("engine error: {0}")]
20    Engine(#[from] mnemo_core::error::Error),
21}