tendermint/abci/response/
exception.rs

1use crate::prelude::*;
2
3#[doc = include_str!("../doc/response-exception.md")]
4#[derive(Clone, PartialEq, Eq, Debug)]
5pub struct Exception {
6    /// Undocumented.
7    pub error: String,
8}
9
10// =============================================================================
11// Protobuf conversions
12// =============================================================================
13
14tendermint_pb_modules! {
15    use super::Exception;
16
17    impl From<Exception> for pb::abci::ResponseException {
18        fn from(exception: Exception) -> Self {
19            Self {
20                error: exception.error,
21            }
22        }
23    }
24
25    impl TryFrom<pb::abci::ResponseException> for Exception {
26        type Error = crate::Error;
27
28        fn try_from(exception: pb::abci::ResponseException) -> Result<Self, Self::Error> {
29            Ok(Self {
30                error: exception.error,
31            })
32        }
33    }
34
35    impl Protobuf<pb::abci::ResponseException> for Exception {}
36}