slim_persistence/errors.rs
1// Copyright AGNTCY Contributors (https://github.com/agntcy)
2// SPDX-License-Identifier: Apache-2.0
3
4use mls_rs_core::error::IntoAnyError;
5use thiserror::Error;
6
7/// Errors from the encrypted persistence layer.
8#[derive(Debug, Error)]
9pub enum PersistenceError {
10 #[error("i/o error: {0}")]
11 Io(#[from] std::io::Error),
12
13 #[error("storage backend error: {0}")]
14 Storage(String),
15}
16
17// Required so `PersistenceError` can be the associated `Error` of the
18// `GroupStateStorage` trait.
19impl IntoAnyError for PersistenceError {}