tendermint/abci/response/
exception.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
use crate::prelude::*;

#[doc = include_str!("../doc/response-exception.md")]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct Exception {
    /// Undocumented.
    pub error: String,
}

// =============================================================================
// Protobuf conversions
// =============================================================================

tendermint_pb_modules! {
    use super::Exception;

    impl From<Exception> for pb::abci::ResponseException {
        fn from(exception: Exception) -> Self {
            Self {
                error: exception.error,
            }
        }
    }

    impl TryFrom<pb::abci::ResponseException> for Exception {
        type Error = crate::Error;

        fn try_from(exception: pb::abci::ResponseException) -> Result<Self, Self::Error> {
            Ok(Self {
                error: exception.error,
            })
        }
    }

    impl Protobuf<pb::abci::ResponseException> for Exception {}
}