Skip to main content

yarli_cli/yarli-memory/src/
error.rs

1//! Memory adapter error types.
2
3use thiserror::Error;
4
5/// Errors from memory operations.
6#[derive(Error, Debug)]
7pub enum MemoryError {
8    /// Memory record not found.
9    #[error("memory not found: {0}")]
10    NotFound(String),
11
12    /// Project or scope does not exist.
13    #[error("scope not found: project={project}, scope={scope}")]
14    ScopeNotFound { project: String, scope: String },
15
16    /// Connection to memory backend failed.
17    #[error("connection failed: {0}")]
18    ConnectionFailed(String),
19
20    /// Memory operation timed out.
21    #[error("operation timed out: {0}")]
22    Timeout(String),
23
24    /// Backend returned an error.
25    #[error("backend error: {0}")]
26    Backend(String),
27
28    /// Content failed redaction check (secrets detected).
29    #[error("redaction required: content may contain secrets")]
30    RedactionRequired,
31
32    /// Scope is closed (read-only).
33    #[error("scope is closed: {0}")]
34    ScopeClosed(String),
35
36    /// Serialization error.
37    #[error("serialization error: {0}")]
38    Serialization(String),
39
40    /// Invalid argument.
41    #[error("invalid argument: {0}")]
42    InvalidArgument(String),
43}