doc_quad/error.rs
1// src/error.rs
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5pub enum DocQuadError {
6 #[error("Invalid buffer dimensions or alignment")]
7 InvalidBuffer,
8
9 #[error("Memory mapping failed: {0}")]
10 MappingError(String),
11
12 #[error("Edge detection failed")]
13 EdgeDetectionError,
14
15 #[error("No valid document quadrilateral found")]
16 NoQuadFound,
17
18 #[error("Internal geometry error")]
19 GeometryError,
20
21 // P2 修复:StrideMismatch 现在在 topology 模块中实际使用
22 #[error("Inconsistent row stride: {0}")]
23 StrideMismatch(String),
24}