rill_lofi/error.rs
1use thiserror::Error;
2
3/// Errors that can occur during lo-fi audio processing.
4#[derive(Error, Debug)]
5pub enum LofiError {
6 /// Invalid bit depth configuration.
7 #[error("Bit depth error: {0}")]
8 BitDepth(String),
9 /// Invalid sample rate configuration.
10 #[error("Sample rate error: {0}")]
11 SampleRate(String),
12 /// Noise generation error.
13 #[error("Noise error: {0}")]
14 Noise(String),
15 /// General processing error.
16 #[error("Processing error: {0}")]
17 Processing(String),
18}
19
20/// Convenience alias for `Result<T, LofiError>`.
21pub type LofiResult<T> = Result<T, LofiError>;