Skip to main content

flow_bot/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum FlowError {
5    #[error("Cannot apply extractor {extractor} to event {event}")]
6    ExtractorError { extractor: String, event: String },
7
8    #[error("Websocket error: {0}")]
9    WebSocketError(#[from] tokio_tungstenite::tungstenite::Error),
10
11    #[error("Ill format message: {0}")]
12    FromUtf8Error(#[from] std::string::FromUtf8Error),
13
14    #[error("Json error: {0}")]
15    JsonError(#[from] serde_json::Error),
16
17    #[error("No connection")]
18    NoConnection,
19
20    #[error("No response")]
21    NoResponse,
22
23    #[error("Request timeout after {0}ms")]
24    Timeout(u64),
25
26    #[error("Reconnection failed after {0} attempts")]
27    ReconnectionFailed(u32),
28
29    #[cfg(feature = "turso")]
30    #[error("Turso error: {0}")]
31    TursoError(#[from] turso::Error),
32}