flexaudio_encode/error.rs
1//! Error and result types for flexaudio-encode.
2
3/// Errors that can occur during flexaudio-encode operations.
4///
5/// Marked `#[non_exhaustive]` so variants can be added later (external matches need `_ =>`).
6#[derive(Debug, thiserror::Error)]
7#[non_exhaustive]
8pub enum EncodeError {
9 /// File I/O failed.
10 #[error("io error: {0}")]
11 Io(#[from] std::io::Error),
12 /// An unsupported parameter, such as channel count, sample rate, or chunk length.
13 #[error("unsupported: {0}")]
14 Unsupported(String),
15 /// An internal FLAC encoder error with a description.
16 #[error("encoder error: {0}")]
17 Encoder(String),
18}
19
20/// Result type used throughout flexaudio-encode.
21pub type Result<T> = std::result::Result<T, EncodeError>;