1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use rusttype::Error as FontError;
use serde_json::error as serde_json_error;
use thiserror::Error;

#[derive(Error, Debug)]
pub enum VcsrError {
    #[error("Arguments are invalid: `{0}`")]
    ArgumentError(String),
    #[error("Input colours are invalid: `{0}`")]
    ColourError(String),
    #[error("Grid must be of the form mxn, where m is the number of columns and n is the number of rows.")]
    GridShape,
    #[error(transparent)]
    IoError(#[from] std::io::Error),
    #[error(transparent)]
    IntError(#[from] std::num::ParseIntError),
    #[error(transparent)]
    FloatError(#[from] std::num::ParseFloatError),
    #[error("Could not find all media attributes")]
    MediaError,
    #[error("Cannot unwrap none")]
    NoneError,
    #[error("Rust Type Font Error")]
    RustTypeError(#[from] FontError),
    #[error("Stream Error")]
    StreamError(#[from] serde_json_error::Error),
    #[error("Invalid timestamps: `{0}`")]
    TimestampError(String),
    #[error("The file does not contain a video stream.")]
    VideoStreamError,
}