scirs2_fft/
error.rs

1//! Error types for the `SciRS2` FFT module
2
3use thiserror::Error;
4
5/// FFT error type
6#[derive(Error, Debug)]
7pub enum FFTError {
8    /// Computation error (generic error)
9    #[error("Computation error: {0}")]
10    ComputationError(String),
11
12    /// Dimension mismatch error
13    #[error("Dimension mismatch error: {0}")]
14    DimensionError(String),
15
16    /// Value error (invalid value)
17    #[error("Value error: {0}")]
18    ValueError(String),
19
20    /// Not implemented error
21    #[error("Not implemented: {0}")]
22    NotImplementedError(String),
23
24    /// I/O error
25    #[error("I/O error: {0}")]
26    IOError(String),
27
28    /// Backend error
29    #[error("Backend error: {0}")]
30    BackendError(String),
31
32    /// Plan creation error
33    #[error("Plan creation error: {0}")]
34    PlanError(String),
35
36    /// Communication error (for distributed FFT)
37    #[error("Communication error: {0}")]
38    CommunicationError(String),
39
40    /// Memory error (e.g., allocation failed)
41    #[error("Memory error: {0}")]
42    MemoryError(String),
43
44    /// Internal error
45    #[error("Internal error: {0}")]
46    InternalError(String),
47}
48
49/// Result type for FFT operations
50pub type FFTResult<T> = Result<T, FFTError>;