realsense_rust/processing_blocks/
errors.rs

1//! Errors that can occur when handling processing blocks.
2
3use crate::kind::Rs2Exception;
4use thiserror::Error;
5
6/// Enumerations of possible errors that can occur when creating a Processing Block
7#[derive(Error, Debug, Clone, PartialEq, Eq)]
8pub enum ProcessingBlockConstructionError {
9    /// Could not create the processing block
10    #[error("Could not create the processing block. Type: {0}; Reason: {1}")]
11    CouldNotCreateProcessingBlock(Rs2Exception, String),
12
13    /// Could not create the processing queue
14    #[error("Could not create the processing queue. Type: {0}; Reason: {1}")]
15    CouldNotCreateProcessingQueue(Rs2Exception, String),
16
17    /// Could not start processing the queue
18    #[error("Could not start processing the queue. Type: {0}; Reason: {1}")]
19    CouldNotStartProcessingQueue(Rs2Exception, String),
20}
21
22/// Enumerations of possible errors that can occur when processing a Processing Block
23#[derive(Debug, Clone, Error, PartialEq, Eq)]
24#[error("Kind: {kind}; Reason: {context}")]
25pub struct ProcessFrameError {
26    /// The RS2 exception that occurred
27    pub kind: Rs2Exception,
28    /// The context in which the error occurred
29    pub context: String,
30}