use thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("CSV error: {0}")]
Csv(#[from] csv::Error),
#[error("invalid timeframe: {0}")]
InvalidTimeframe(String),
#[error("indicator-core error: {0}")]
Core(#[from] wickra_core::Error),
#[error("malformed payload: {0}")]
Malformed(String),
#[cfg(feature = "live-binance")]
#[error("websocket error: {0}")]
WebSocket(#[from] tokio_tungstenite::tungstenite::Error),
#[cfg(feature = "live-binance")]
#[error("JSON decode error: {0}")]
Json(#[from] serde_json::Error),
}
pub type Result<T> = core::result::Result<T, Error>;