1use thiserror::Error;
2
3#[derive(Error, Debug)]
5pub enum TsdbError {
6 #[error("I/O error: {0}")]
8 Io(#[from] std::io::Error),
9
10 #[error("Compression error: {0}")]
12 Compression(String),
13
14 #[error("Decompression error: {0}")]
16 Decompression(String),
17
18 #[error("Invalid series ID: {0}")]
20 InvalidSeriesId(u64),
21
22 #[error("Invalid time range: start={start}, end={end}")]
24 InvalidTimeRange {
25 start: i64,
27 end: i64,
29 },
30
31 #[error("Series not found: {0}")]
33 SeriesNotFound(u64),
34
35 #[error("Chunk not found for series {series_id} at {timestamp}")]
37 ChunkNotFound {
38 series_id: u64,
40 timestamp: i64,
42 },
43
44 #[error("Write buffer full: {0} points pending")]
46 BufferFull(usize),
47
48 #[error("Write-Ahead Log error: {0}")]
50 Wal(String),
51
52 #[error("Configuration error: {0}")]
54 Config(String),
55
56 #[error("Query error: {0}")]
58 Query(String),
59
60 #[error("Integration error: {0}")]
62 Integration(String),
63}
64
65pub type TsdbResult<T> = Result<T, TsdbError>;