Skip to main content

chromaprint/
error.rs

1/// Errors that can occur during fingerprinting.
2#[derive(Debug, thiserror::Error)]
3pub enum Error {
4    #[error("invalid sample rate: {0} (must be > 1000)")]
5    InvalidSampleRate(u32),
6
7    #[error("invalid channel count: {0} (must be >= 1)")]
8    InvalidChannelCount(u16),
9
10    #[error("unknown algorithm: {0}")]
11    UnknownAlgorithm(u8),
12
13    #[error("resampling not available (enable 'resample' feature)")]
14    ResamplingUnavailable,
15
16    #[error("invalid fingerprint data")]
17    InvalidFingerprint,
18
19    #[error("pipeline not started (call start() first)")]
20    NotStarted,
21
22    #[error("resampling error: {0}")]
23    Resample(String),
24}
25
26pub type Result<T> = std::result::Result<T, Error>;