use std::path::PathBuf;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum PreviewError {
#[error("file not found: path={path}")]
FileNotFound {
path: PathBuf,
},
#[error("no video stream found: path={path}")]
NoVideoStream {
path: PathBuf,
},
#[error("seek failed: target={target:?} reason={reason}")]
SeekFailed {
target: std::time::Duration,
reason: String,
},
#[error("decode failed: {0}")]
Decode(#[from] ff_decode::DecodeError),
#[error("ffmpeg error: {message} (code={code})")]
Ffmpeg {
code: i32,
message: String,
},
#[error("probe failed: {0}")]
Probe(#[from] ff_probe::ProbeError),
#[cfg(feature = "proxy")]
#[error("pipeline failed: {0}")]
Pipeline(#[from] ff_pipeline::PipelineError),
#[error("io error: {0}")]
Io(#[from] std::io::Error),
}