tendermint_config/
error.rs

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
38
use std::io::Error as IoError;

use flex_error::{define_error, DisplayOnly};
use tendermint::Error as TendermintError;

define_error! {
    #[derive(Debug, Clone, PartialEq, Eq)]
    Error {
        Io
            [ DisplayOnly<IoError> ]
            |_| { format_args!("I/O error") },

        FileIo
            { path: String }
            [ DisplayOnly<IoError> ]
            |e| { format_args!("failed to open file: {}", e.path) },

        Parse
            { data: String }
            | e | { format_args!("error parsing data: {}", e.data) },

        SerdeJson
            [ DisplayOnly<serde_json::Error> ]
            |_| { format_args!("serde json error") },

        Toml
            [ DisplayOnly<toml::de::Error> ]
            |_| { format_args!("toml de error") },

        ParseUrl
            [ DisplayOnly<url::ParseError> ]
            |_| { format_args!("error parsing url error") },

        Tendermint
            [ TendermintError ]
            |_| { format_args!("tendermint error") },
    }
}