#[derive(Debug)]
pub enum StreckenInfoError {
RequestError(reqwest::Error),
WebsocketError(tokio_tungstenite::tungstenite::Error),
WebSocketNoRevisionError,
JsonError(serde_json::Error),
InvalidResponse,
ResponseError(String),
ReferenceError,
}
impl From<reqwest::Error> for StreckenInfoError {
fn from(value: reqwest::Error) -> Self {
Self::RequestError(value)
}
}
impl From<tokio_tungstenite::tungstenite::Error> for StreckenInfoError {
fn from(value: tokio_tungstenite::tungstenite::Error) -> Self {
Self::WebsocketError(value)
}
}
impl From<serde_json::Error> for StreckenInfoError {
fn from(value: serde_json::Error) -> Self {
Self::JsonError(value)
}
}