Skip to main content

koth_ms/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum KothError {
5    #[error("IO error: {0}")]
6    Io(#[from] std::io::Error),
7
8    #[error("Unsupported input format: {0}")]
9    UnsupportedFormat(String),
10
11    #[error("mzML parse error: {0}")]
12    MzmlError(String),
13
14    #[cfg(feature = "tdf")]
15    #[error("Bruker TDF error: {0}")]
16    TdfError(String),
17
18    // Ungated: the `thermo` feature does not enable `tdf`, so the Thermo reader
19    // needs an error variant that exists in a thermo-only build.
20    #[error("Thermo .raw error: {0}")]
21    ThermoError(String),
22
23    #[error("CSV write error: {0}")]
24    CsvError(#[from] csv::Error),
25
26    #[error("JSON error: {0}")]
27    JsonError(#[from] serde_json::Error),
28
29    #[error("Config error: {0}")]
30    ConfigError(String),
31
32    #[error("No spectra found in input file")]
33    NoSpectra,
34
35    #[error("Parquet error: {0}")]
36    ParquetError(String),
37}