rusty_bin/monitor/collector/
error.rs1use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum CollectionError {
8 #[error("Exchange connection failed: {exchange} - {reason}")]
10 ConnectionFailed {
11 exchange: String,
13 reason: String,
15 },
16
17 #[error("Symbol discovery failed: {exchange} - {reason}")]
19 SymbolDiscoveryFailed {
20 exchange: String,
22 reason: String,
24 },
25
26 #[error("Subscription error: {exchange} - {reason}")]
28 SubscriptionError {
29 exchange: String,
31 reason: String,
33 },
34
35 #[error("Data processing error: {0}")]
37 DataProcessing(String),
38
39 #[error("Configuration error: {0}")]
41 Configuration(String),
42
43 #[error("Provider error: {0}")]
45 Provider(#[from] Box<dyn std::error::Error + Send + Sync>),
46}
47
48pub type Result<T> = std::result::Result<T, CollectionError>;