Skip to main content

rypipe_core/
error.rs

1use thiserror::Error;
2
3/// Crate-wide error type.
4#[derive(Debug, Error)]
5pub enum Error {
6    /// Invalid UTF-8 in input bytes.
7    #[error("invalid UTF-8: {0}")]
8    Utf8(#[from] simdutf8::basic::Utf8Error),
9
10    /// I/O failure (read, seek, mmap, etc.).
11    #[error("I/O error: {0}")]
12    Io(#[from] std::io::Error),
13
14    /// Invalid or inconsistent execution plan.
15    #[error("plan error: {0}")]
16    Plan(String),
17
18    /// Merge conflict between chunks (e.g. column type mismatch).
19    #[error("merge error: {0}")]
20    Merge(String),
21
22    /// Arrow array/batch construction failure.
23    #[error("Arrow error: {0}")]
24    Arrow(#[from] arrow::error::ArrowError),
25}
26
27/// Shorthand result type used throughout the crate.
28pub type Result<T> = std::result::Result<T, Error>;