1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum Error {
8 #[error("I/O error: {0}")]
9 Io(#[from] std::io::Error),
10
11 #[error("CSV error: {0}")]
12 Csv(#[from] csv::Error),
13
14 #[error("invalid timeframe: {0}")]
15 InvalidTimeframe(String),
16
17 #[error("indicator-core error: {0}")]
18 Core(#[from] wickra_core::Error),
19
20 #[error("malformed payload: {0}")]
21 Malformed(String),
22
23 #[error("read timed out")]
25 Timeout,
26
27 #[cfg(feature = "live-binance")]
28 #[error("websocket error: {0}")]
29 WebSocket(#[from] tokio_tungstenite::tungstenite::Error),
30
31 #[cfg(feature = "live-binance")]
32 #[error("JSON decode error: {0}")]
33 Json(#[from] serde_json::Error),
34}
35
36pub type Result<T> = core::result::Result<T, Error>;