ffmpeg_frame_grabber/
error.rs1use snafu::Snafu;
2use std::io;
3use std::{
4 fmt::{Debug, Display, Formatter},
5 path::PathBuf,
6};
7
8impl Debug for FFMpegError {
9 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
10 Display::fmt(self, f)
11 }
12}
13
14#[derive(Snafu)]
15#[snafu(visibility = "pub")]
16pub enum FFMpegError {
17 #[snafu(display("File '{}' does not exists.", file.to_string_lossy()))]
18 FileDoesNotExistsError { file: PathBuf },
19 #[snafu(display("Could not parse ffmpeg/ffprobe output."))]
20 ParseError,
21 #[snafu(display("Failed to spawn ffmpeg/ffprobe. {}", source))]
22 CommandSpawnError { source: io::Error },
23 #[snafu(display("Failed to read data from ffmpeg/ffprobe. {}", source))]
24 IOError { source: io::Error },
25}