layer_shika_domain/
errors.rs

1use std::error::Error;
2use std::result::Result as StdResult;
3use thiserror::Error as ThisError;
4
5pub type Result<T> = StdResult<T, DomainError>;
6
7#[derive(ThisError, Debug)]
8pub enum DomainError {
9    #[error("invalid configuration: {message}")]
10    Configuration { message: String },
11
12    #[error("invalid dimensions {width}x{height}")]
13    InvalidDimensions { width: u32, height: u32 },
14
15    #[error("invalid input: {message}")]
16    InvalidInput { message: String },
17
18    #[error("calculation error: {operation} failed - {reason}")]
19    Calculation { operation: String, reason: String },
20
21    #[error("component '{name}' not found")]
22    ComponentNotFound { name: String },
23
24    #[error("channel closed")]
25    ChannelClosed,
26
27    #[error("surface not found: {message}")]
28    SurfaceNotFound { message: String },
29
30    #[error("output not found: {message}")]
31    OutputNotFound { message: String },
32
33    #[error("adapter error")]
34    Adapter {
35        #[source]
36        source: Box<dyn Error + Send + Sync>,
37    },
38}