u_nesting_core/
error.rs

1//! Error types for U-Nesting.
2
3use thiserror::Error;
4
5/// Result type alias for U-Nesting operations.
6pub type Result<T> = std::result::Result<T, Error>;
7
8/// Errors that can occur during nesting/packing operations.
9#[derive(Debug, Error)]
10pub enum Error {
11    /// Invalid geometry provided.
12    #[error("Invalid geometry: {0}")]
13    InvalidGeometry(String),
14
15    /// Invalid boundary provided.
16    #[error("Invalid boundary: {0}")]
17    InvalidBoundary(String),
18
19    /// Configuration error.
20    #[error("Configuration error: {0}")]
21    ConfigError(String),
22
23    /// NFP computation failed.
24    #[error("NFP computation failed: {0}")]
25    NfpError(String),
26
27    /// No valid placement found.
28    #[error("No valid placement found for geometry: {0}")]
29    NoPlacement(String),
30
31    /// Computation cancelled.
32    #[error("Computation cancelled")]
33    Cancelled,
34
35    /// Timeout exceeded.
36    #[error("Timeout exceeded after {0}ms")]
37    Timeout(u64),
38
39    /// Serialization error.
40    #[cfg(feature = "serde")]
41    #[error("Serialization error: {0}")]
42    SerializationError(String),
43
44    /// Internal error.
45    #[error("Internal error: {0}")]
46    Internal(String),
47}