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
37
pub mod archive;
pub mod distribution;
pub mod live;
pub mod snapshot;
pub mod voters;

use crate::stats::archive::{ArchiveCalculatorError, ArchiveReaderError};
use jormungandr_automation::testing::block0::Block0Error;
use jormungandr_lib::interfaces::Block0ConfigurationError;
use thiserror::Error;

#[allow(clippy::large_enum_variant)]
#[derive(Error, Debug)]
pub enum Error {
    #[error("get block0")]
    GetBlock0(#[from] Block0Error),
    #[error("reqwest error")]
    Reqwest(#[from] reqwest::Error),
    #[error("block0 parse error")]
    Block0Parse(#[from] Block0ConfigurationError),
    #[error("io error")]
    Io(#[from] std::io::Error),
    #[error("read error")]
    Read(#[from] chain_ser::deser::ReadError),
    #[error("bech32 error")]
    Bech32(#[from] bech32::Error),
    #[error("csv error")]
    Csv(#[from] csv::Error),
    #[error("archive reader error")]
    ArchiveReader(#[from] ArchiveReaderError),
    #[error("archive calculator error")]
    ArchiveCalculator(#[from] ArchiveCalculatorError),
    #[error(transparent)]
    Serde(#[from] serde_json::Error),
    #[error(transparent)]
    Live(#[from] live::Error),
}