sakurs_core/api/
error.rs

1//! Error types for the API
2
3use thiserror::Error;
4
5/// Error type for API operations
6#[derive(Debug, Error)]
7pub enum Error {
8    /// Configuration error
9    #[error("Configuration error: {0}")]
10    Configuration(String),
11
12    /// Invalid language specification
13    #[error("Invalid language: {0}")]
14    InvalidLanguage(String),
15
16    /// Processing error from the application layer
17    #[error("Processing error: {0}")]
18    Processing(#[from] crate::application::config::ProcessingError),
19
20    /// Infrastructure error (I/O, etc.)
21    #[error("Infrastructure error: {0}")]
22    Infrastructure(String),
23
24    /// Invalid input
25    #[error("Invalid input: {0}")]
26    InvalidInput(String),
27
28    /// Unsupported feature
29    #[error("Feature not supported: {0}")]
30    Unsupported(String),
31}
32
33/// Result type for API operations
34pub type Result<T> = std::result::Result<T, Error>;