use alloc::string::String;
use thiserror::Error;
pub type Result<T> = core::result::Result<T, Error>;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum Error {
#[error("playlist is not valid UTF-8: {0}")]
PlaylistNotUtf8(#[from] core::str::Utf8Error),
#[error("playlist parse: {0}")]
PlaylistParse(#[from] transmux::Error),
#[error("resource delivered for an id the client did not request: {id:?}")]
UnrequestedResource {
id: super::action::ResourceId,
},
#[error("resource {id:?} delivered before the init segment was available")]
InitNotYetAvailable {
id: super::action::ResourceId,
},
#[error("demux of resource {id:?} failed: {source}")]
Demux {
id: super::action::ResourceId,
#[source]
source: transmux::Error,
},
#[error("could not resolve URI {uri:?} against base {base:?}: {reason}")]
UriResolve {
uri: String,
base: String,
reason: &'static str,
},
}