miden_crypto/merkle/smt/large/storage/
error.rs1use alloc::{boxed::Box, string::String};
2
3#[derive(Debug, thiserror::Error)]
11pub enum StorageError {
12 #[error("backend error: {0}")]
14 Backend(#[from] Box<dyn core::error::Error + Send + Sync + 'static>),
15 #[error("invalid key length: expected {expected} bytes, found {found}")]
17 BadKeyLen { expected: usize, found: usize },
18 #[error(
20 "invalid subtree key length at depth {depth}: expected {expected} bytes, found {found}"
21 )]
22 BadSubtreeKeyLen { depth: u8, expected: usize, found: usize },
23 #[error("invalid value length for {what}: expected {expected} bytes, found {found}")]
25 BadValueLen {
26 what: &'static str,
27 expected: usize,
28 found: usize,
29 },
30 #[error("leaf operation failed")]
32 Leaf(#[from] crate::merkle::smt::SmtLeafError),
33 #[error("failed to decode subtree")]
35 Subtree(#[from] crate::merkle::smt::SubtreeError),
36 #[error("operation not supported: {0}")]
38 Unsupported(String),
39 #[error("failed to decode value bytes")]
41 Value(#[from] crate::utils::DeserializationError),
42}