| 285 | /// This captures issues that occur while walking the file tree structure. |
| 286 | #[derive(Debug, Error)] |
| 287 | pub enum TreeError { |
| 288 | /// Pristine database error. |
| 289 | #[error("Pristine error: {0}")] |
| 290 | Pristine(#[from] PristineError), |
| 291 | |
| 292 | /// A directory entry points to a non-existent inode. |
| 293 | #[error("Orphan directory entry: {name} -> {inode:?}")] |
| 294 | OrphanEntry { |
| 295 | /// Name of the directory entry |
| 296 | name: String, |
| 297 | /// The inode it points to |
| 298 | inode: Inode, |
| 299 | }, |
| 300 | |
| 301 | /// Circular reference in the file tree. |
| 302 | #[error("Circular reference detected at path: {path}")] |
| 303 | CircularReference { |
| 304 | /// The path where the cycle was detected |
| 305 | path: PathBuf, |
| 306 | }, |
| 307 | |
| 308 | /// Maximum tree depth exceeded. |
| 309 | #[error("Maximum tree depth exceeded: {depth} (limit: {limit})")] |
| 310 | MaxDepthExceeded { |
| 311 | /// Current depth |
| 312 | depth: usize, |
| 313 | /// Maximum allowed depth |
| 314 | limit: usize, |
| 315 | }, |
| 316 | } |
| 317 | |
| 318 | impl From<TreeError> for OutputError { |
| 319 | fn from(err: TreeError) -> Self { |
no outgoing calls
no test coverage detected