1use rust_decimal::Decimal;
2use std::ffi::OsString;
3use std::io;
4use std::num::NonZeroUsize;
5use std::path::PathBuf;
6use thiserror::Error;
7
8#[derive(Debug, Error)]
9pub enum Error {
10 #[error("IO operation failed: {0:?}")]
11 Io(#[from] io::Error),
12 #[error("Failed to execute Ffprobe")]
13 FfprobeCommand,
14 #[error("Failed to execute ffmpeg")]
15 FfmpegCommand,
16 #[error("Failed to execute AI command")]
17 AICommand,
18 #[error("Command parse failure: {0}")]
19 ParseError(#[from] shell_words::ParseError),
20 #[error("Decimal error: {0}")]
21 Decimal(#[from] rust_decimal::Error),
22 #[error("Unable to create scene time ranges:\nstart {0}\nmax_step_size {1}\nend {2}")]
23 UnableToCreateTimeRanges(Decimal, NonZeroUsize, Decimal),
24 #[error("Unable to calculate expected frame count from FPS: {0}")]
25 BadFPS(NonZeroUsize),
26 #[error("Multiplcation overflow: {0} * {1}")]
27 MultiplicationOverflow(String, String),
28 #[error("Missing extension for file: {0}")]
29 MissingExtension(PathBuf),
30 #[error("Invalid Unicode: {0:?}")]
31 InvalidUnicode(OsString),
32 #[error("Unable to read dir: {0:?}")]
33 ReadDir(PathBuf),
34}