kithara_queue/error.rs
1use kithara_events::TrackId;
2use kithara_play::PlayError;
3
4/// Errors from the [`Queue`](crate::Queue) orchestration layer.
5#[derive(Debug, thiserror::Error)]
6#[non_exhaustive]
7pub enum QueueError {
8 /// Source URL failed to parse as a URL or absolute file path.
9 #[error("invalid URL or path: {0}")]
10 InvalidUrl(String),
11
12 /// The given [`TrackId`] is not present in the queue.
13 #[error("unknown track id: {0:?}")]
14 UnknownTrackId(TrackId),
15
16 /// Operation attempted on a track that has not finished loading.
17 #[error("track not ready: {0:?}")]
18 NotReady(TrackId),
19
20 /// Load attempt aborted: superseded by a newer selection or torn down with its track.
21 #[error("load cancelled: {0:?}")]
22 Cancelled(TrackId),
23
24 /// Error bubbled up from `kithara-play`.
25 #[error(transparent)]
26 Play(#[from] PlayError),
27
28 /// Resource construction failed (decoding, config, or I/O).
29 #[error("resource error: {0}")]
30 Resource(String),
31}