aranya_runtime/vm_policy/error.rs
1use crate::{engine::EngineError, storage::StorageError};
2
3#[derive(Debug, thiserror::Error)]
4/// Errors that can occur because of creation or use of VmPolicy.
5pub enum VmPolicyError {
6 /// An error happened while deserializing a command struct. Stores an interior
7 /// [postcard::Error].
8 #[error("deserialize error: {0}")]
9 Deserialization(#[from] postcard::Error),
10 /// An error happened while executing policy. Stores an interior [EngineError].
11 #[error("engine error: {0}")]
12 EngineError(#[from] EngineError),
13 /// An error happened at the storage layer. Stores an interior [StorageError].
14 #[error("storage error: {0}")]
15 StorageError(#[from] StorageError),
16 /// Some other happened and we don't know what it is.
17 #[error("unknown error")]
18 Unknown,
19}