1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! Error types for Rust Entity Framework.
use thiserror::Error;
/// Represents all possible errors that can occur in lref operations.
#[derive(Error, Debug)]
pub enum LrefError {
/// Database connection error.
#[error("database connection error: {0}")]
Connection(String),
/// Query execution error.
#[error("query error: {0}")]
Query(String),
/// Entity not found error.
#[error("entity not found: {0}")]
NotFound(String),
/// Model validation error.
#[error("model validation error: {0}")]
ModelValidation(String),
/// Migration error.
#[error("migration error: {0}")]
Migration(String),
/// Provider-specific error.
#[error("provider error: {0}")]
Provider(String),
/// Configuration error.
#[error("configuration error: {0}")]
Configuration(String),
/// Change tracking error.
#[error("change tracking error: {0}")]
ChangeTracking(String),
/// Transaction error.
#[error("transaction error: {0}")]
Transaction(String),
/// Concurrency conflict error.
#[error("concurrency conflict: {0}")]
ConcurrencyConflict(String),
/// Type conversion error.
#[error("type conversion error: {0}")]
TypeConversion(String),
/// General / unknown error.
#[error("{0}")]
Other(String),
}
/// Result type alias for lref operations.
pub type LrefResult<T> = Result<T, LrefError>;