exif_oxide/types/
errors.rs

1//! Error types for exif-oxide
2//!
3//! This module defines the error types used throughout the exif-oxide library,
4//! following ExifTool's error classification patterns.
5
6use crate::file_detection::FileDetectionError;
7use thiserror::Error;
8
9/// Error types for exif-oxide
10// TODO: Enhance error types to match ExifTool's sophisticated error classification system (warnings, errors, fatal)
11#[derive(Error, Debug)]
12pub enum ExifError {
13    #[error("IO error: {0}")]
14    Io(#[from] std::io::Error),
15
16    #[error("Invalid file format: {0}")]
17    InvalidFormat(String),
18
19    #[error("Parsing error: {0}")]
20    ParseError(String),
21
22    #[error("Unsupported feature: {0}")]
23    Unsupported(String),
24
25    #[error("Registry error: {0}")]
26    Registry(String),
27
28    #[error("File detection error: {0}")]
29    FileDetection(#[from] FileDetectionError),
30}
31
32/// Result type alias for convenience
33pub type Result<T> = std::result::Result<T, ExifError>;