aerosieve_decode/
error.rs1use std::path::PathBuf;
2
3#[derive(Debug, thiserror::Error)]
5pub enum DecodeError {
6 #[error("cannot open {}: {source}", path.display())]
8 Open {
9 path: PathBuf,
10 #[source]
11 source: std::io::Error,
12 },
13
14 #[error("read failed: {0}")]
16 Read(#[source] std::io::Error),
17
18 #[error("unsupported or unrecognized audio format: {0}")]
20 UnsupportedFormat(String),
21
22 #[error("no audio track found in input")]
23 NoAudioTrack,
24
25 #[error("audio track has no declared sample rate")]
26 MissingSampleRate,
27
28 #[error("audio track declares an unsupported sample rate of {0} Hz")]
29 UnsupportedSampleRate(u32),
30
31 #[error("audio is longer than the configured limit of {limit_s} s")]
32 TooLong { limit_s: f32 },
33
34 #[error("decode error: {0}")]
36 Decode(String),
37
38 #[error("resample error: {0}")]
39 Resample(String),
40
41 #[error("invalid decode config: {0}")]
42 InvalidConfig(&'static str),
43}