Skip to main content

magic_bird/
error.rs

1//! Error types for BIRD operations.
2
3use std::path::PathBuf;
4
5#[derive(Debug, thiserror::Error)]
6pub enum Error {
7    #[error("IO error: {0}")]
8    Io(#[from] std::io::Error),
9
10    #[error("DuckDB error: {0}")]
11    DuckDb(#[from] duckdb::Error),
12
13    #[error("Configuration error: {0}")]
14    Config(String),
15
16    #[error("Storage error: {0}")]
17    Storage(String),
18
19    #[error("BIRD not initialized at {0}")]
20    NotInitialized(PathBuf),
21
22    #[error("BIRD already initialized at {0}")]
23    AlreadyInitialized(PathBuf),
24
25    #[error("Invalid path: {0}")]
26    InvalidPath(String),
27
28    #[error("Not found: {0}")]
29    NotFound(String),
30
31    #[error("Extension error: {0}")]
32    Extension(String),
33}
34
35pub type Result<T> = std::result::Result<T, Error>;