diff --git a/src/error.rs b/src/error.rs new file mode 100644 index 0000000..2277908 --- /dev/null +++ b/src/error.rs @@ -0,0 +1,21 @@ +use thiserror::Error; + +#[derive(Debug, Error)] +pub enum ProbeError { + #[error("Video file not found: {0}")] + FileNotFound(String), + + #[error("Failed to execute ffprobe: {0}")] + FfprobeExecution(#[from] std::io::Error), + + #[error("Failed to parse ffprobe output: {0}")] + ParseError(#[from] serde_json::Error), + + #[error("ffprobe returned non-zero exit code: {0}")] + FfprobeFailed(String), + + #[error("No video stream found")] + NoVideoStream, +} + +pub type Result = std::result::Result; \ No newline at end of file