Skip to main content

oximedia_scene/
error.rs

1//! Error types for scene understanding.
2
3use thiserror::Error;
4
5/// Result type for scene operations.
6pub type SceneResult<T> = Result<T, SceneError>;
7
8/// Error types for scene understanding operations.
9#[derive(Error, Debug)]
10pub enum SceneError {
11    /// Invalid input dimensions.
12    #[error("Invalid dimensions: {0}")]
13    InvalidDimensions(String),
14
15    /// Invalid parameter value.
16    #[error("Invalid parameter: {0}")]
17    InvalidParameter(String),
18
19    /// Feature extraction failed.
20    #[error("Feature extraction failed: {0}")]
21    FeatureExtractionFailed(String),
22
23    /// Classification failed.
24    #[error("Classification failed: {0}")]
25    ClassificationFailed(String),
26
27    /// Detection failed.
28    #[error("Detection failed: {0}")]
29    DetectionFailed(String),
30
31    /// Segmentation failed.
32    #[error("Segmentation failed: {0}")]
33    SegmentationFailed(String),
34
35    /// Model not loaded.
36    #[error("Model not loaded: {0}")]
37    ModelNotLoaded(String),
38
39    /// Insufficient data for analysis.
40    #[error("Insufficient data: {0}")]
41    InsufficientData(String),
42
43    /// Computer vision error.
44    #[error("CV error: {0}")]
45    CvError(#[from] oximedia_cv::error::CvError),
46
47    /// Core error.
48    #[error("Core error: {0}")]
49    CoreError(#[from] oximedia_core::error::OxiError),
50
51    /// ML pipeline error (only available when the `onnx` feature is enabled).
52    #[cfg(feature = "onnx")]
53    #[error("ML error: {0}")]
54    MlError(#[from] oximedia_ml::MlError),
55}