Skip to main content

mq_conv/
error.rs

1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, Error>;
4
5#[derive(Error, Debug)]
6pub enum Error {
7    #[error("IO error: {0}")]
8    Io(#[from] std::io::Error),
9
10    #[error("Unsupported format: {0}")]
11    UnsupportedFormat(String),
12
13    #[error("Format detection failed: could not determine file type")]
14    DetectionFailed,
15
16    #[error("Conversion error ({format}): {message}")]
17    Conversion {
18        format: &'static str,
19        message: String,
20    },
21
22    #[error("Feature not enabled: {0}. Recompile with --features {0}")]
23    FeatureDisabled(String),
24}