//! SAIL Kernel Error Types //! //! Centralized, typed errors for all kernel operations. //! Uses `thiserror` for ergonomic, zero-cost error handling with no `unwrap`. use thiserror::Error; /// All possible errors in the SAIL kernel #[derive(Error, Debug)] pub enum KernelError { #[error("I/O error: {0}")] IoError(String), #[error("Arrow write error: {0}")] ArrowError(String), #[error("Compression error: {0}")] CompressionError(String), #[error("Tokenizer error: {0}")] TokenizerError(String), #[error("Invalid input: {0}")] InvalidInput(String), } impl From for pyo3::PyErr { fn from(err: KernelError) -> pyo3::PyErr { pyo3::exceptions::PyRuntimeError::new_err(err.to_string()) } }