1use std::path::PathBuf;
2
3#[derive(Debug, thiserror::Error)]
5#[non_exhaustive]
6pub enum Error {
7 #[error("{path}: {source}")]
8 Io {
9 path: PathBuf,
10 source: std::io::Error,
11 },
12 #[error("{path}:{line}: invalid .cube LUT: {msg}")]
13 CubeParse {
14 path: PathBuf,
15 line: usize,
16 msg: String,
17 },
18 #[error("invalid {what}: {value:?}")]
19 Invalid { what: &'static str, value: String },
20 #[error("{path}: {msg}")]
22 Track { path: String, msg: String },
23 #[error("{path}: col {col}: {msg}\n {src}\n {caret}^", caret = " ".repeat(col.saturating_sub(1)))]
25 Expr {
26 path: String,
27 col: usize,
28 msg: String,
29 src: String,
30 },
31 #[error("{path}: {msg}")]
32 Import { path: PathBuf, msg: String },
33 #[error("invalid OTIO JSON: {0}")]
34 Json(#[from] serde_json::Error),
35 #[error("{0} is not implemented yet")]
37 Unimplemented(&'static str),
38 #[error("{0}")]
40 Pipeline(String),
41 #[error("{api}: {msg}")]
43 Gpu { api: &'static str, msg: String },
44 #[cfg(feature = "ffmpeg")]
45 #[error("ffmpeg: {0}")]
46 Ffmpeg(#[from] ffmpeg_next::Error),
47}
48
49pub type Result<T, E = Error> = std::result::Result<T, E>;