| //! 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 | |
| pub enum KernelError { | |
| IoError(String), | |
| ArrowError(String), | |
| CompressionError(String), | |
| TokenizerError(String), | |
| InvalidInput(String), | |
| } | |
| impl From<KernelError> for pyo3::PyErr { | |
| fn from(err: KernelError) -> pyo3::PyErr { | |
| pyo3::exceptions::PyRuntimeError::new_err(err.to_string()) | |
| } | |
| } | |