ave_core/helpers/db/
error.rs1use thiserror::Error;
5
6#[derive(Debug, Clone, Error)]
8pub enum DatabaseError {
9 #[error("failed to lock database connection")]
11 MutexLock,
12
13 #[error("database pool error: {0}")]
15 Pool(String),
16
17 #[error("failed to open database connection: {0}")]
19 ConnectionOpen(String),
20
21 #[error("migration failed: {0}")]
23 Migration(String),
24
25 #[error("failed to create database directory: {0}")]
27 DirectoryCreation(String),
28
29 #[error("query failed: {0}")]
31 Query(String),
32
33 #[error("JSON serialization failed: {0}")]
35 JsonSerialize(String),
36
37 #[error("JSON deserialization failed: {0}")]
39 JsonDeserialize(String),
40
41 #[error("integer conversion failed: {0}")]
43 IntegerConversion(String),
44
45 #[error("subject not found: {0}")]
47 SubjectNotFound(String),
48
49 #[error("governance not found: {0}")]
51 GovernanceNotFound(String),
52
53 #[error("event not found for subject {subject_id} at sn {sn}")]
55 EventNotFound { subject_id: String, sn: u64 },
56
57 #[error("no events found for subject: {0}")]
59 NoEvents(String),
60
61 #[error("date/time parse failed: {0}")]
63 DateTimeParse(String),
64
65 #[error("invalid pagination cursor: {0}")]
67 InvalidCursor(String),
68
69 #[error("database blocking task failed: {0}")]
71 BlockingTask(String),
72}