openlimits_binance/
binance_content_error.rs

1use serde::Deserialize;
2use serde::Serialize;
3use serde_json::Value;
4use std::collections::HashMap;
5use std::fmt;
6use thiserror::Error;
7
8
9/// This struct represents a openlimits-binance content error
10#[derive(Serialize, Deserialize, Debug, Error)]
11pub struct BinanceContentError {
12    pub code: i16,
13    pub msg: String,
14
15    #[serde(flatten)]
16    extra: HashMap<String, Value>,
17}
18
19impl fmt::Display for BinanceContentError {
20    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
21        write!(f, "error code: {} msg: {}", self.code, self.msg)
22    }
23}