honeycomb_core/cmap/
error.rs1use crate::{attributes::AttributeError, cmap::DartIdType};
4
5#[derive(Debug, thiserror::Error, PartialEq, Eq)]
7#[error("cannot reserve {0} darts: not enough unused darts")]
8pub struct DartReservationError(pub usize);
9
10#[derive(Debug, thiserror::Error, PartialEq, Eq)]
12#[error("cannot set dart {0} as unused: dart isn't free")]
13pub struct DartReleaseError(pub DartIdType);
14
15#[derive(Debug, thiserror::Error, PartialEq, Eq)]
17pub enum LinkError {
18 #[error("cannot link {1} to {2}: b{0}({1}) != NULL")]
20 NonFreeBase(u8, DartIdType, DartIdType),
21 #[error("cannot link {1} to {2}: b{0}({2}) != NULL")]
23 NonFreeImage(u8, DartIdType, DartIdType),
24 #[error("cannot unlink {1}: b{0}({1}) == NULL")]
26 AlreadyFree(u8, DartIdType),
27 #[error("cannot 3-link {0} and {1}: faces do not have the same structure")]
29 AsymmetricalFaces(DartIdType, DartIdType),
30}
31
32#[derive(Debug, thiserror::Error, PartialEq, Eq)]
34pub enum SewError {
35 #[error("cannot {0}-sew darts {1} and {2} due to geometry predicates")]
37 BadGeometry(u8, DartIdType, DartIdType),
38 #[error("inner link failed: {0}")]
40 FailedLink(#[from] LinkError),
41 #[error("attribute operation failed: {0}")]
43 FailedAttributeOp(#[from] AttributeError),
44}