use thiserror::Error;
use crate::client::ManifestFault;
#[derive(Debug, Clone, PartialEq, Eq, Error)]
#[non_exhaustive]
pub enum SmoothError {
#[error("manifest declares a Protection element; protected content is not supported")]
ManifestProtected,
#[error("fragment carries sample-encryption boxes; protected content is not supported")]
FragmentEncrypted,
#[error("manifest unusable after retries: {0}")]
Manifest(ManifestFault),
#[error("manifest resolves no usable video or audio stream")]
NoUsableStream,
#[error("chunk timeline of stream {stream} is unusable: {reason}")]
Timeline {
stream: usize,
reason: String,
},
#[error("fragment fetch failed (status {status:?})")]
Fragment {
status: Option<u16>,
},
#[error("track setup failed: {reason}")]
TrackSetup {
reason: String,
},
}