hyperstack_sdk/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum HyperStackError {
5    #[error("Missing WebSocket URL")]
6    MissingUrl,
7
8    #[error("Connection failed: {0}")]
9    ConnectionFailed(String),
10
11    #[error("WebSocket error: {0}")]
12    WebSocket(#[from] tokio_tungstenite::tungstenite::Error),
13
14    #[error("JSON serialization error: {0}")]
15    Serialization(#[from] serde_json::Error),
16
17    #[error("Max reconnection attempts reached ({0})")]
18    MaxReconnectAttempts(u32),
19
20    #[error("Connection closed")]
21    ConnectionClosed,
22
23    #[error("Subscription failed: {0}")]
24    SubscriptionFailed(String),
25
26    #[error("Channel error: {0}")]
27    ChannelError(String),
28}