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 = "kv-store")]
59 #[error("KV store error: {0}")]
60 Store(#[from] oxistore_core::StoreError),
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("Tile not found")]
102 TileNotFound,
103
104 #[cfg(feature = "tile-http")]
106 #[error("HTTP error: status {status}, url: {url}")]
107 HttpError {
108 status: u16,
110 url: String,
112 },
113
114 #[cfg(feature = "tile-http")]
116 #[error("HTTP client error: {0}")]
117 Reqwest(#[from] reqwest::Error),
118
119 #[error("Incomplete finalize: expected {expected} chunks, wrote {actual}")]
121 IncompleteFinalize {
122 expected: usize,
124 actual: usize,
126 },
127
128 #[error("Other error: {0}")]
130 Other(String),
131}
132
133#[cfg(feature = "std")]
134impl<T> From<crossbeam_channel::SendError<T>> for StreamingError {
135 fn from(_: crossbeam_channel::SendError<T>) -> Self {
136 StreamingError::SendError
137 }
138}
139
140#[cfg(feature = "std")]
141impl From<crossbeam_channel::RecvError> for StreamingError {
142 fn from(_: crossbeam_channel::RecvError) -> Self {
143 StreamingError::RecvError
144 }
145}
146
147#[cfg(feature = "std")]
148impl From<serde_json::Error> for StreamingError {
149 fn from(e: serde_json::Error) -> Self {
150 StreamingError::SerializationError(e.to_string())
151 }
152}