text_document_common/
error.rs1use thiserror::Error;
4
5use crate::types::EntityId;
6
7#[derive(Debug, Error)]
9pub enum RepositoryError {
10 #[error(transparent)]
12 Database(#[from] redb::Error),
13
14 #[error(transparent)]
16 Table(#[from] redb::TableError),
17
18 #[error(transparent)]
20 Storage(#[from] redb::StorageError),
21
22 #[error(transparent)]
24 Transaction(#[from] redb::TransactionError),
25
26 #[error(transparent)]
28 Commit(#[from] redb::CommitError),
29
30 #[error(transparent)]
32 DatabaseOp(#[from] redb::DatabaseError),
33
34 #[error("{entity} id {id} already in use")]
36 DuplicateId { entity: &'static str, id: EntityId },
37
38 #[error("{operation}: child entities do not exist: {ids:?}")]
40 MissingRelationshipTarget {
41 operation: &'static str,
42 ids: Vec<EntityId>,
43 },
44
45 #[error("serialization error: {0}")]
47 Serialization(String),
48}