oxigdal_streaming/
error.rs1#[cfg(not(feature = "std"))]
4use alloc::string::String;
5
6pub type Result<T> = core::result::Result<T, StreamingError>;
8
9#[derive(Debug, thiserror::Error)]
11pub enum StreamingError {
12 #[cfg(feature = "std")]
14 #[error("OxiGDAL error: {0}")]
15 Core(#[from] oxigdal_core::error::OxiGdalError),
16
17 #[error("Stream is closed")]
19 StreamClosed,
20
21 #[error("Stream buffer is full")]
23 BufferFull,
24
25 #[error("Invalid window configuration: {0}")]
27 InvalidWindow(String),
28
29 #[error("Watermark error: {0}")]
31 WatermarkError(String),
32
33 #[error("State error: {0}")]
35 StateError(String),
36
37 #[error("Checkpoint error: {0}")]
39 CheckpointError(String),
40
41 #[error("Partition error: {0}")]
43 PartitionError(String),
44
45 #[error("Join error: {0}")]
47 JoinError(String),
48
49 #[error("Serialization error: {0}")]
51 SerializationError(String),
52
53 #[error("Deserialization error: {0}")]
55 DeserializationError(String),
56
57 #[cfg(feature = "rocksdb-backend")]
59 #[error("RocksDB error: {0}")]
60 RocksDB(#[from] rocksdb::Error),
61
62 #[cfg(feature = "std")]
64 #[error("IO error: {0}")]
65 Io(#[from] std::io::Error),
66
67 #[cfg(feature = "std")]
69 #[error("Arrow error: {0}")]
70 Arrow(#[from] arrow::error::ArrowError),
71
72 #[error("Channel send error")]
74 SendError,
75
76 #[error("Channel receive error")]
78 RecvError,
79
80 #[error("Operation timed out")]
82 Timeout,
83
84 #[error("Invalid state: {0}")]
86 InvalidState(String),
87
88 #[error("Configuration error: {0}")]
90 ConfigError(String),
91
92 #[error("Invalid operation: {0}")]
94 InvalidOperation(String),
95
96 #[error("Not implemented: {0}")]
98 NotImplemented(String),
99
100 #[error("Other error: {0}")]
102 Other(String),
103}
104
105#[cfg(feature = "std")]
106impl<T> From<crossbeam_channel::SendError<T>> for StreamingError {
107 fn from(_: crossbeam_channel::SendError<T>) -> Self {
108 StreamingError::SendError
109 }
110}
111
112#[cfg(feature = "std")]
113impl From<crossbeam_channel::RecvError> for StreamingError {
114 fn from(_: crossbeam_channel::RecvError) -> Self {
115 StreamingError::RecvError
116 }
117}
118
119#[cfg(feature = "std")]
120impl From<serde_json::Error> for StreamingError {
121 fn from(e: serde_json::Error) -> Self {
122 StreamingError::SerializationError(e.to_string())
123 }
124}