use std::path::PathBuf;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("{path}: {source}")]
Io {
path: PathBuf,
source: std::io::Error,
},
#[error("{path}:{line}: invalid .cube LUT: {msg}")]
CubeParse {
path: PathBuf,
line: usize,
msg: String,
},
#[error("invalid {what}: {value:?}")]
Invalid { what: &'static str, value: String },
#[error("{path}: {msg}")]
Track { path: String, msg: String },
#[error("{path}: col {col}: {msg}\n {src}\n {caret}^", caret = " ".repeat(col.saturating_sub(1)))]
Expr {
path: String,
col: usize,
msg: String,
src: String,
},
#[error("{path}: {msg}")]
Import { path: PathBuf, msg: String },
#[error("invalid OTIO JSON: {0}")]
Json(#[from] serde_json::Error),
#[error("{0} is not implemented yet")]
Unimplemented(&'static str),
#[error("{0}")]
Pipeline(String),
#[error("{api}: {msg}")]
Gpu { api: &'static str, msg: String },
#[cfg(feature = "ffmpeg")]
#[error("ffmpeg: {0}")]
Ffmpeg(#[from] ffmpeg_next::Error),
}
pub type Result<T, E = Error> = std::result::Result<T, E>;