1use serde::Deserialize;
2use error_chain::error_chain;
3
4#[derive(Debug, Deserialize)]
5pub struct BinanceContentError {
6 pub code: i16,
7 pub msg: String,
8}
9
10error_chain! {
11 errors {
12 BinanceError(response: BinanceContentError)
13
14 KlineValueMissingError(index: usize, name: &'static str) {
15 description("invalid Vec for Kline"),
16 display("{} at {} is missing", name, index),
17 }
18 }
19
20 foreign_links {
21 ReqError(reqwest::Error);
22 InvalidHeaderError(reqwest::header::InvalidHeaderValue);
23 IoError(std::io::Error);
24 ParseFloatError(std::num::ParseFloatError);
25 UrlParserError(url::ParseError);
26 Json(serde_json::Error);
27 Tungstenite(tungstenite::Error);
28 TimestampError(std::time::SystemTimeError);
29 }
30}