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
32
33
34
35
36
use std::path::PathBuf;

use tokio::task::JoinError;

#[derive(thiserror::Error, Debug)]
pub enum Error {
    #[error("I/O error at path {}: {}", path.to_string_lossy(), message)]
    IOError {
        #[source]
        source: std::io::Error,
        path: PathBuf,
        message: &'static str,
    },

    #[error("I/O error: {}", message)]
    AsyncIOError {
        #[source]
        source: tokio::io::Error,
        message: &'static str,
    },

    #[error("Terra render error")]
    RenderError(tera::Error),

    #[error("Failed to parse JSON")]
    JsonParseError(serde_json::Error),

    #[error("Subtask join error")]
    JoinError(JoinError),

    #[error("Internal error")]
    Internal { message: String },

    #[error("Error parsing a config file (nom error)")]
    ConfigParseError { message: String },
}