#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("An Error occurred while requesting web content: {0}")]
Request(#[from] reqwest::Error),
#[error(transparent)]
Youtube(#[from] Youtube),
}
#[derive(Debug, thiserror::Error, PartialEq, Eq, Clone)]
pub struct Youtube(pub(crate) String);
impl std::fmt::Display for Youtube {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", &self.0)
}
}
#[derive(thiserror::Error, Debug, Clone)]
pub enum Id<const N: usize> {
#[error("Found invalid id: '{0}'")]
InvalidId(String),
#[error("Expected a id of length {N} but found a id of length {0}")]
InvalidLength(usize),
}