use alloc::string::String;
use thiserror::Error;
pub type Result<T> = core::result::Result<T, Error>;
#[derive(Debug, Error, PartialEq)]
#[non_exhaustive]
pub enum Error {
#[error("hls parse (line {line_no}): {reason}\n {line}")]
HlsParse {
line_no: usize,
line: String,
reason: String,
},
#[error("attribute value {value:?} is not valid as {kind}")]
InvalidAttrValue {
value: String,
kind: &'static str,
},
#[error("{0} is not a finite, non-negative decimal-floating-point number of seconds")]
InvalidDecimalSeconds(f64),
#[error("{0} is not a finite decimal-floating-point number of seconds")]
InvalidSignedDecimalSeconds(f64),
#[error("{what} {value:?} contains {bad_char:?}, forbidden in an HLS quoted-string")]
InvalidQuotedString {
what: String,
bad_char: char,
value: String,
},
#[error("URI {value:?} ({what}) contains {bad_char:?}, forbidden in an HLS URI")]
InvalidUri {
what: String,
bad_char: char,
value: String,
},
}