weave/
errors.rs

1// Errors in the weave code.
2
3use std::{io, result};
4use thiserror::Error;
5
6#[derive(Error, Debug)]
7pub enum Error {
8    #[error("I/O Error")]
9    Io(#[from] io::Error),
10    #[error("Json error")]
11    Json(#[from] serde_json::Error),
12    #[error("Parsing Error")]
13    Parse(#[from] std::num::ParseIntError),
14    #[error("tag \"name\" missing")]
15    NameMissing,
16    #[error("already closed")]
17    AlreadyClosed,
18    #[error("unexpected end of weave file")]
19    UnexpectedEof,
20    #[error("weave file appears empty")]
21    EmptyWeave,
22    #[error("diff error status {0}")]
23    DiffError(i32),
24    #[error("diff killed by signal")]
25    DiffKilled,
26}
27
28pub type Result<T> = result::Result<T, Error>;