Skip to main content

text_document_common/
error.rs

1// Generated by Qleany v1.4.8 from error.tera
2
3use thiserror::Error;
4
5use crate::types::EntityId;
6
7/// Errors that can occur in the repository / table layer.
8#[derive(Debug, Error)]
9pub enum RepositoryError {
10    /// An entity with the given id already exists.
11    #[error("{entity} id {id} already in use")]
12    DuplicateId { entity: &'static str, id: EntityId },
13
14    /// A relationship target does not exist.
15    #[error("{operation}: child entities do not exist: {ids:?}")]
16    MissingRelationshipTarget {
17        operation: &'static str,
18        ids: Vec<EntityId>,
19    },
20
21    /// Serialization / deserialization failed.
22    #[error("serialization error: {0}")]
23    Serialization(String),
24}