1use crate::storage::page::PageId;
18use thiserror::Error;
19
20#[derive(Debug, Error)]
21pub enum EntDbError {
22 #[error("i/o error: {0}")]
23 Io(#[from] std::io::Error),
24
25 #[error("page {0} not found")]
26 PageNotFound(PageId),
27
28 #[error("buffer pool full: no evictable pages")]
29 BufferPoolFull,
30
31 #[error("invalid page data: {0}")]
32 InvalidPage(String),
33
34 #[error("page {0} is pinned")]
35 PagePinned(PageId),
36
37 #[error("page {0} already exists in buffer pool")]
38 PageAlreadyPresent(PageId),
39
40 #[error("corruption detected: {0}")]
41 Corruption(String),
42
43 #[error("wal error: {0}")]
44 Wal(String),
45
46 #[error("query error: {0}")]
47 Query(String),
48}
49
50pub type Result<T> = std::result::Result<T, EntDbError>;