use cortex_ai::FlowError;
use thiserror::Error;
#[derive(Error, Debug, Clone)]
pub enum SourceError {
#[error("IO error: {0}")]
Io(String),
#[error("{0}")]
Custom(String),
}
impl From<std::io::Error> for SourceError {
fn from(err: std::io::Error) -> Self {
Self::Io(err.to_string())
}
}
impl From<FlowError> for SourceError {
fn from(err: FlowError) -> Self {
Self::Custom(err.to_string())
}
}
pub type SourceResult<T> = std::result::Result<T, SourceError>;