binance_history/
error.rs

1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, Error>;
4
5#[derive(Debug, Error)]
6pub enum Error {
7
8    #[error("The directory '{0}' does not exist")]
9    DirectoryNotFound(String),
10
11    #[error(transparent)]
12    Reqwest(#[from] reqwest::Error),
13
14    #[error(transparent)]
15    InvalidUrl(#[from] url::ParseError),
16
17    #[error(transparent)]
18    Io(#[from] std::io::Error),
19
20    #[error(transparent)]
21    Zip(#[from] zip::result::ZipError),
22
23    #[error("The archive '{0}' is empty and cannot be extracted")]
24    EmptyArchiveError(String),
25
26    #[error(transparent)]
27    Csv(#[from] csv::Error),
28
29    #[error("Failed to download the file from '{0}'. HTTP status code: {1}")]
30    DownloadError(String, String),
31
32    #[error("The kline's interval is missing")]
33    MissingKlinesInterval,
34}